This guide covers how to install and set up DotGitHub for your project.
Before installing DotGitHub, ensure you have the following:
- Node.js 18.0.0 or higher
- npm or yarn package manager
- Git for version control
- GitHub account (for accessing GitHub Actions)
Install DotGitHub globally to use it across all your projects:
npm install -g @dotgithub/cliOr using yarn:
yarn global add @dotgithub/cliInstall DotGitHub as a development dependency in your project:
npm install --save-dev @dotgithub/cliOr using yarn:
yarn add --dev @dotgithub/cliRun DotGitHub without installing it:
npx @dotgithub/cliAfter installation, verify that DotGitHub is working correctly:
dotgithub --versionYou should see output similar to:
0.1.1
DotGitHub requires a GitHub token for accessing GitHub Actions metadata. Set up your token:
- Go to GitHub Settings > Developer settings > Personal access tokens
- Click "Generate new token (classic)"
- Give it a descriptive name (e.g., "DotGitHub CLI")
- Select the following scopes:
repo(for private repositories)public_repo(for public repositories)read:packages(if using GitHub Packages)
Set the token as an environment variable:
export GITHUB_TOKEN=ghp_your_token_hereset GITHUB_TOKEN=ghp_your_token_here$env:GITHUB_TOKEN="ghp_your_token_here"Add the environment variable to your shell profile:
echo 'export GITHUB_TOKEN=ghp_your_token_here' >> ~/.bashrcecho 'export GITHUB_TOKEN=ghp_your_token_here' >> ~/.zshrcset -gx GITHUB_TOKEN ghp_your_token_hereCreate a new DotGitHub project:
dotgithub initThis creates:
src/dotgithub.json- Configuration filesrc/package.json- Node.js package filesrc/tsconfig.json- TypeScript configurationsrc/index.ts- Entry point file
Navigate to the generated directory and install dependencies:
cd src
npm installAdd a GitHub Action to your project:
dotgithub add actions/checkout@v4Create your first workflow:
dotgithub synthThe main configuration file contains:
{
"version": "1.0.0",
"rootDir": "src",
"outputDir": ".github/workflows",
"actions": [],
"constructs": [],
"stacks": [],
"options": {
"tokenSource": "env",
"formatting": {
"prettier": true
}
}
}- rootDir - Directory for generated TypeScript files
- outputDir - Directory for generated workflow files
- actions - Array of tracked GitHub Actions
- constructs - Array of construct configurations
- stacks - Array of stack configurations
Install recommended extensions:
code --install-extension ms-vscode.vscode-typescript-next
code --install-extension esbenp.prettier-vscodeDotGitHub generates TypeScript files with full type safety. Your IDE should automatically provide:
- IntelliSense for action inputs/outputs
- Type checking for workflow definitions
- Auto-completion for action parameters
If you get permission errors on macOS/Linux:
sudo npm install -g @dotgithub/cliVerify your token is set correctly:
echo $GITHUB_TOKENIf you're behind a corporate firewall, you may need to configure npm proxy settings:
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080Ensure you're using Node.js 18+:
node --versionIf you need to manage multiple Node.js versions, consider using:
- nvm (Linux/macOS)
- nvm-windows (Windows)
If you encounter issues:
- Check the troubleshooting section
- Review the command documentation
- Check the GitHub issues
- Join the Discord community
After installation, you can:
- Get started with your first workflow
- Learn about the CLI commands
- Explore construct development
- Read the API reference
To remove DotGitHub:
npm uninstall -g @dotgithub/clinpm uninstall @dotgithub/clirm -rf src/dotgithub.json src/package.json src/tsconfig.json src/index.ts