Publishing
Publish your Trik to the TrikHub registry so others can find and install it.
Prerequisites
Before publishing, make sure you have:
- Logged in with
trik login(authenticates via GitHub) - A public GitHub repository with your Trik code pushed
manifest.jsonwith the correctversionfieldtrikhub.jsonat the repo root with registry metadata (includingrepositoryURL)dist/directory committed to git (TypeScript only) — compiled JavaScript output must be in the repo. Python triks do not needdist/.
Validating with trik lint
Before publishing, validate your Trik locally:
trik lint .This checks:
- Manifest structure and required fields
- TDPS rules (e.g., outputSchema uses agent-safe types)
- Entry point file exists at the declared path
Publishing runs this same validation automatically, but linting first helps catch issues early.
You can also treat warnings as errors:
trik lint . --warnings-as-errorsPublishing Flow
1. Set the version in manifest.json
{
"version": "1.0.0"
}2. Commit and push all code to GitHub
Make sure dist/ is committed (not in .gitignore):
# TypeScript: build first
npm run build
git add .
git commit -m "v1.0.0"
git pushPython triks skip the build step — source files are loaded directly.
3. Create a git tag matching the version
The tag must follow the format v{version}:
git tag v1.0.04. Push the tag to GitHub
git push origin v1.0.05. Run trik publish
From your project root:
trik publishThe CLI will:
- Validate your Trik using the linter
- Read
manifest.jsonfor the version - Read
trikhub.jsonfor the repository URL - Verify the git tag
v1.0.0exists on the remote - Extract the commit SHA the tag points to
- Register the Trik and version with the registry
Updating a Version
Same flow — update the version, tag, and publish:
# 1. Make your changes
# 2. Update version in manifest.json to "1.1.0"
# 3. Commit and push
git add .
git commit -m "v1.1.0"
git push
# 4. Create and push a new tag
git tag v1.1.0
git push origin v1.1.0
# 5. Publish
trik publishEach version is published independently. Previous versions remain available.
Unpublishing
To permanently remove a Trik from the registry:
trik unpublish @yourname/my-trikThis removes the Trik and all its versions. Users who already installed it keep their local copy, but no new installations will be possible.
Troubleshooting
Tag not found on remote
Error: Tag v1.0.0 not found on remoteMake sure you pushed the tag: git push origin v1.0.0. The tag must exist on the remote, not just locally.
Git remote does not match trikhub.json repository
Repository mismatch detected:
trikhub.json: https://github.com/owner/repo
git remote: git@github.com:other/repo.gitThe repository URL in trikhub.json must match your git remote origin. Update one or the other to match.
dist/ not committed
TypeScript only. Python triks do not need a dist/ directory.
If your compiled output isn’t in git, the registry won’t be able to access it. Make sure dist/ is not in .gitignore and is committed:
git add dist/
git commit -m "Add compiled output"
git pushNot a git repository
Publishing requires a git repository with a remote. Initialize one if needed:
git init
git remote add origin https://github.com/yourusername/my-trik