Initialize a new GitHub Actions workspace with TypeScript and ESM support.
dotgithub init [options]The init command sets up a new DotGitHub project by creating the necessary directory structure, configuration files, and TypeScript setup. This is typically the first command you run when starting a new project.
--force- Overwrite existing files if they exist--output <dir>- Output directory for the workspace (default:src)
The init command creates the following files and directories:
- Configuration file:
dotgithub.jsonin the output directory - Workspace directory: A subdirectory (default:
src) containing:package.json- Node.js package configuration with TypeScript supporttsconfig.json- TypeScript compiler configurationindex.ts- Basic entry point file
dotgithub initThis creates a src/ directory with all necessary files.
dotgithub init --output ./my-workflowsThis creates a my-workflows/ directory instead of src/.
dotgithub init --forceThis will overwrite any existing files in the target directory.
The main configuration file that tracks:
- Actions to generate
- Construct configurations
- Stack definitions
- Output settings
A Node.js package file with:
- TypeScript dependencies
- Build scripts
- DotGitHub core dependencies
TypeScript configuration optimized for:
- ES2022 target
- ESNext modules
- Strict type checking
- Source maps and declarations
A basic entry point that imports the DotGitHub core library.
After running init, you typically:
- Navigate to the workspace directory:
cd src - Install dependencies:
npm install - Add GitHub Actions:
dotgithub add actions/checkout@v4 - Write your workflow logic in TypeScript
- Synthesize workflows:
dotgithub synth
The command will fail if:
- Files already exist and
--forceis not specified - The output directory cannot be created
- There are permission issues writing files
- dotgithub add - Add GitHub Actions to your project
- dotgithub synth - Generate workflow files
- Configuration Guide - Understanding dotgithub.json