CLI Commands
The trik CLI helps you discover, install, and manage 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 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:
- Downloads the trik from GitHub releases
- Extracts to
.trikhub/triks/<trik>/ - Adds to
.trikhub/config.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
Example 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)
Example:
trik search article
trik search weather -l 5trik 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@2.0.0
Article Search
Searches for articles on a given topic.
Demonstrates type-directed privilege separation.
Actions:
search Search for articles by topic (template)
details Get article details (passthrough)
list List article summaries (passthrough)
Repository: github.com/molefas/article-searchtrik 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/pip and add them to config.
trik syncOptions:
-n, --dry-run- Show what would be synced-j, --json- Output as JSON
When to use:
If you install a trik package directly via npm or pip:
npm install @trikhub/article-search
trik syncAuthentication
trik login
Authenticate with GitHub for publishing.
trik loginOpens a browser for GitHub OAuth. 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-trikConfig File
The CLI manages .trikhub/config.json:
{
"triks": [
"@molefas/article-search",
"@acme/weather"
]
}This file is read by the gateway to load triks at runtime.
Global Options
Available on all commands:
--dev- Use development registry (localhost:3001)--version- Show CLI version--help- Show help
Next: Learn about SDK Integration to use triks in your code.