Skip to content
forked from surelle-ha/Dogma

Dogma is a CLI tool that enables interaction with the GitHub API for the purpose of searching .env files with specified keywords. You can configure a GitHub token and use the crawler to search for keys in .env files across public repositories.

License

Notifications You must be signed in to change notification settings

base64-one/Dogma

 
 

Repository files navigation



DOGMA

This is a personal CLI tool that enables interaction with the GitHub API for the purpose of searching .env files with specified keywords. You can configure a GitHub token and use the crawler to search for keys in .env files across public repositories.

Table of Contents

Features

  • Configure GitHub Token: Set your GitHub Personal Access Token to make authorized API requests.
  • Search .env Files: Search for .env files on GitHub using a keyword and optionally filter for empty or non-empty key values.
  • Quiet Output: Optionally disable detailed output to see every step of the search.
  • Save Results to Log: Save search results to a log file for future reference.

Getting Started

Follow these instructions to get the tool up and running on your local machine:

Prerequisites

  • Node.js installed on your machine.
  • A GitHub Personal Access Token (PAT) for making API requests.

Installing Dependencies

  1. Clone the repository:

    git clone https://github.com/surelle-ha/dogma.git
    cd dogma
  2. Install the required dependencies:

    npm install

Set Up GitHub Token

Before using the crawler, you need to configure your GitHub token:

dogma config -t <your-github-token>

This will save your GitHub token in the configuration file located at ~/.github_crawler_config.json.

Commands

Config Command

The config command allows you to configure the GitHub Personal Access Token for use in API requests.

dogma config -t <your-github-token>
  • -t, --token <token>: Set your GitHub token.

Example:

dogma config -t ghp_1234567890abcdefg

This command will save your GitHub token in the configuration file and allow you to use the crawler command.

Crawl Command

The crawl command searches for .env files on GitHub repositories containing a specified keyword.

dogma crawl -k <keyword> --not-empty --quiet --log <log-file>
  • -k, --keyword <string>: The keyword to search in .env files (default: API_KEY).
  • --not-empty: Only search for keys with non-empty values.
  • --empty: Search for keys with empty values (default behavior).
  • -q, --quiet: Disable detailed output for the search.
  • --log <file>: Save the search results to a log file.

Example:

dogma crawl -k "API_KEY" --not-empty --quiet --log search_results.json

This will search for .env files containing the API_KEY keyword, filter for non-empty values, and save the results to search_results.json.

Contributing

We welcome contributions to improve this project!

How to Contribute

  1. Fork the Repository: Fork the repository to your GitHub account.
  2. Clone the Repository: Clone your fork to your local machine.
  3. Create a Feature Branch: Create a new branch for your feature or bug fix.
  4. Commit Your Changes: Make changes and commit them with a descriptive message.
  5. Push Changes: Push your changes to your forked repository.
  6. Create a Pull Request: Submit a pull request to the original repository with a detailed description of your changes.

Code of Conduct

We expect all contributors to follow our Code of Conduct. Please ensure that you contribute in a respectful and inclusive manner.

License

This project is licensed under the MIT License - see the LICENSE file for details.

surellebanner1512

About

Dogma is a CLI tool that enables interaction with the GitHub API for the purpose of searching .env files with specified keywords. You can configure a GitHub token and use the crawler to search for keys in .env files across public repositories.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.3%
  • JavaScript 0.7%