Skip to main content
Share your workflow package by publishing it to a public GitHub repository. Others can then import it using the codemachine import command.

Prerequisites

Before publishing, ensure your workflow package has:
  • A valid manifest file (codemachine.json)
  • At least one agent definition in config/main.agents.js
  • At least one workflow file in your workflows directory

Create the Manifest

Every publishable package needs a codemachine.json file at the repository root.

Minimal Manifest

For packages using the default directory structure:
codemachine.json
{
  "name": "my-workflow",
  "version": "1.0.0"
}

Full Manifest

For packages with custom directory layouts or additional metadata:
codemachine.json
{
  "name": "my-workflow",
  "version": "1.0.0",
  "description": "A workflow for building React applications",
  "paths": {
    "config": "config",
    "workflows": "templates/workflows",
    "prompts": "prompts",
    "characters": "config/agent-characters.json"
  }
}

Required Fields

FieldDescription
namePackage identifier (must be unique)
versionSemantic version (e.g., 1.0.0)

Optional Fields

FieldDescription
descriptionBrief description of the workflow
pathsCustom paths for package resources

Custom Paths

If your repository has an existing structure that doesn’t match the defaults, use the paths field to map your directories.

Default Paths

When paths is omitted, CodeMachine uses these defaults:
ResourceDefault Path
Configconfig/
Workflowstemplates/workflows/
Promptsprompts/
Charactersconfig/agent-characters.json

When to Use Custom Paths

If you’re creating a new repository for your workflow, use the default structure—no paths configuration needed.
my-workflow/
├── codemachine.json
├── config/
│   └── main.agents.js
├── templates/
│   └── workflows/
│       └── my-workflow.workflow.js
└── prompts/
    └── ...

Publish to GitHub

1

Initialize Repository

Create a new GitHub repository or use an existing one.
# New repository
mkdir my-workflow-codemachine
cd my-workflow-codemachine
git init
2

Add Manifest

Create your codemachine.json at the repository root.
echo '{
  "name": "my-workflow",
  "version": "1.0.0"
}' > codemachine.json
3

Add Required Files

Ensure you have the required configuration and workflow files.
mkdir -p config templates/workflows prompts
# Add your main.agents.js, workflow files, and prompts
4

Push to GitHub

Commit and push to a public repository.
git add .
git commit -m "Initial workflow package"
git remote add origin https://github.com/username/my-workflow-codemachine.git
git push -u origin main
Your repository must be public for others to import it. GitHub private repositories cannot be fetched by the import system.

After Publishing

Once published, users can import your workflow using any of these formats:
# By owner/repo
codemachine import username/my-workflow-codemachine

# By full URL
codemachine import https://github.com/username/my-workflow-codemachine

# By short name (if using -codemachine suffix)
codemachine import my-workflow
The imported workflow will be available in the workflow selection menu when running codemachine.

Private Workflows

If you prefer to keep your workflow private, you can share it via local import instead of publishing to a public repository.
For private workflows, share the package directory directly and have users import it locally. See Import Workflows - Local Imports for details.

Naming Conventions

For discoverability, consider using the -codemachine suffix in your repository name:
  • my-workflow-codemachine
  • react-builder-codemachine
  • api-generator-codemachine
This allows users to import by short name:
codemachine import my-workflow
CodeMachine searches GitHub for repositories matching {name}-codemachine when using short name imports.