CLI Commands
The trik CLI helps you discover, install, manage, and develop triks.
Installation
npm install -g @trikhub/cliOr use with npx:
npx @trikhub/cli <command>Verify installation:
trik --versionCommands
trik install
Install a trik from the TrikHub registry.
trik install <trik>
trik i <trik> # aliasOptions:
-v, --version <version>- Install a specific version
Examples:
# Install latest version
trik install @molefas/article-search
# Install specific version
trik install @molefas/article-search -v 2.0.0
# Shorthand
trik i @acme/weatherWhat happens:
- Checks the TrikHub registry for the trik
- Verifies the git tag’s commit SHA matches the registry record (security check)
- For same-language triks (JS trik in JS project): adds a git URL to
package.jsonand runs your package manager’s install - For cross-language triks (e.g. Python trik in JS project): downloads to
.trikhub/triks/<trik>/ - If not found on TrikHub: falls back to npm for third-party packages
- Registers the trik in
.trikhub/config.json - If the trik declares
config.required, shows the required configuration keys and how to set them up insecrets.json
trik uninstall
Remove an installed trik.
trik uninstall <trik>
trik rm <trik> # alias
trik remove <trik> # aliasExample:
trik uninstall @molefas/article-search
trik rm @acme/weathertrik list
List installed triks.
trik list
trik ls # aliasOptions:
-j, --json- Output as JSON-r, --runtime <runtime>- Filter by runtime (nodeorpython)
Example:
trik list --runtime pythonExample output:
Installed triks:
@molefas/article-search@2.0.0
@acme/weather@1.2.0trik search
Search the registry for triks.
trik search <query>
trik s <query> # aliasOptions:
-j, --json- Output as JSON-l, --limit <number>- Limit results (default: 10)-r, --runtime <runtime>- Filter by runtime (nodeorpython)
Example:
trik search article
trik search weather -l 5
trik search weather --runtime nodetrik info
Show detailed information about a trik.
trik info <trik>Options:
-j, --json- Output as JSON
Example:
trik info @molefas/article-searchOutput:
@molefas/article-search
Searches for articles on a given topic.
Agent Info
Mode: conversational
Domain: content curation, article discovery
Tools: search, details, list
Security Tier: B (Network)
Stats
Latest version: 2.0.0
Downloads: 1.2K
Stars: 42trik init
Scaffold a new trik project with boilerplate code.
trik init <language>Arguments:
<language>-ts(TypeScript) orpy(Python)
Examples:
trik init ts # TypeScript project
trik init py # Python projectThis launches an interactive wizard that asks for:
- Trik name, display name, description
- Author name and GitHub username
- Category
- Agent mode (conversational or tool)
- Handoff description (for conversational mode)
- Tool names (for tool mode)
- Domain tags
- Storage and config preferences
The wizard generates a complete project with manifest, source files, and build configuration.
trik lint
Validate a trik’s manifest and source files for security and correctness.
trik lint <path>Options:
--warnings-as-errors- Treat warnings as errors--skip <rule>- Skip a specific rule (can be used multiple times)
Example:
trik lint .
trik lint ./my-trik --warnings-as-errorsRules checked:
valid-manifest— Manifest must be valid JSON and match the schemamanifest-completeness— Check for recommended manifest fieldsentry-point-exists— Entry point in manifest must existtdps-agent-safe-output— outputSchema strings must use constrained typestdps-constrained-log— logSchema strings must have at least one constrainttdps-log-template— logTemplate placeholders must match logSchema fieldstdps-output-template— outputTemplate placeholders must match outputSchema fields
Security tier: The linter scans all source files and classifies the trik into a security tier (A through D) based on detected capabilities such as network access, filesystem usage, or process execution. The tier is informational and does not block publishing.
trik upgrade
Upgrade installed triks.
trik upgrade [trik]
trik up [trik] # aliasOptions:
-f, --force- Force reinstall even if up to date
Examples:
# Upgrade specific trik
trik upgrade @molefas/article-search
# Upgrade all triks
trik upgrade
# Force reinstall
trik upgrade --forcetrik sync
Discover triks installed via npm and add them to config.
trik syncOptions:
-n, --dry-run- Show what would be synced-j, --json- Output as JSON
trik mcp
Start or configure the TrikHub MCP server for AI-assisted trik development.
trik mcp # Show configuration instructions
trik mcp --stdio # Start MCP server in stdio modeSetup for Claude Code:
Add this to your MCP settings:
{
"mcpServers": {
"trikhub": {
"command": "npx",
"args": ["-y", "@trikhub/mcp"]
}
}
}The MCP server provides tools for:
analyze_trik_requirements— Understand what to builddesign_tool— Design tool schemas with log templatesdesign_log_schema— Create constrained log schemasscaffold_trik— Generate complete projectvalidate_manifest— Check manifest for errorsdiagnose_error— Explain and fix errors
Authentication
trik login
Authenticate with GitHub for publishing.
trik loginOpens a browser for GitHub device authorization. Tokens are stored securely.
trik logout
Remove saved authentication.
trik logouttrik whoami
Show current authenticated user.
trik whoamiPublishing
trik publish
Publish a trik to the registry.
trik publishOptions:
-d, --directory <path>- Trik directory (default: current dir)-t, --tag <version>- Version tag (default: from manifest)
Requirements:
- Must be logged in (
trik login) - Must have a valid
manifest.json - Must have a GitHub repository
Example:
cd my-trik
trik publish
# Or from another directory
trik publish -d ./triks/my-triktrik unpublish
Permanently remove a trik from the TrikHub registry.
trik unpublish <trik>Example:
trik unpublish @molefas/old-trikThis requires confirmation — you must type the full trik name to confirm. This action deletes the trik and all its versions permanently.
Config File
The CLI manages .trikhub/config.json:
{
"triks": [
"@molefas/article-search",
"@acme/weather"
]
}This file is read by the gateway at runtime to load triks. The triks array is a flat list of package names — the gateway resolves them from node_modules or .trikhub/triks/.
Global Options
Available on all commands:
--dev- Use development registry (localhost:3001)--version- Show CLI version--help- Show help
Next: Learn about the Gateway API to use triks in your code.