CLI Reference
Complete reference for the trik command-line interface.
Installation
npm install -g @trikhub/cliSynopsis
trik <command> [options]Global Options
| Option | Description |
|---|---|
--dev | Use development registry (localhost:3001) |
--version | Show version number |
--help | Show help |
Commands
install
Install a trik from the registry.
trik install <trik> [options]
trik i <trik> [options]Arguments:
| Argument | Description |
|---|---|
trik | Trik identifier (e.g., @molefas/article-search) |
Options:
| Option | Description |
|---|---|
-v, --version <version> | Install specific version |
Examples:
trik install @molefas/article-search
trik i @molefas/article-search -v 2.0.0uninstall
Remove an installed trik.
trik uninstall <trik>
trik rm <trik>
trik remove <trik>Arguments:
| Argument | Description |
|---|---|
trik | Trik identifier to remove |
Examples:
trik uninstall @molefas/article-search
trik rm @acme/weatherlist
List installed triks.
trik list [options]
trik ls [options]Options:
| Option | Description |
|---|---|
-j, --json | Output as JSON |
Examples:
trik list
trik ls --jsonsearch
Search the registry for triks.
trik search <query> [options]
trik s <query> [options]Arguments:
| Argument | Description |
|---|---|
query | Search query |
Options:
| Option | Description |
|---|---|
-j, --json | Output as JSON |
-l, --limit <number> | Limit results (default: 10) |
Examples:
trik search weather
trik s "article search" -l 5info
Show detailed information about a trik.
trik info <trik> [options]Arguments:
| Argument | Description |
|---|---|
trik | Trik identifier |
Options:
| Option | Description |
|---|---|
-j, --json | Output as JSON |
Examples:
trik info @molefas/article-search
trik info @molefas/article-search --jsonupgrade
Upgrade installed triks.
trik upgrade [trik] [options]
trik up [trik] [options]Arguments:
| Argument | Description |
|---|---|
trik | Optional trik identifier (upgrades all if omitted) |
Options:
| Option | Description |
|---|---|
-f, --force | Force reinstall even if up to date |
Examples:
trik upgrade # Upgrade all
trik upgrade @molefas/article-search # Upgrade specific
trik up --force # Force reinstall allsync
Discover triks installed via npm and add to config.
trik sync [options]Options:
| Option | Description |
|---|---|
-n, --dry-run | Show what would be synced |
-j, --json | Output as JSON |
Examples:
trik sync
trik sync --dry-runlogin
Authenticate with GitHub.
trik loginOpens browser for GitHub OAuth authentication. Tokens are stored in:
- macOS: Keychain
- Linux: Secret Service
- Windows: Credential Manager
logout
Remove saved authentication.
trik logoutwhoami
Show current authenticated user.
trik whoamipublish
Publish a trik to the registry.
trik publish [options]Options:
| Option | Description |
|---|---|
-d, --directory <path> | Trik directory (default: .) |
-t, --tag <version> | Version tag (default: from manifest) |
Examples:
trik publish
trik publish -d ./my-trik
trik publish -t 1.0.1Config File
The CLI manages .trikhub/config.json:
{
"triks": [
{
"id": "@molefas/article-search",
"version": "2.0.0",
"path": ".trikhub/triks/@molefas/article-search"
}
]
}| Field | Description |
|---|---|
id | Trik identifier |
version | Installed version |
path | Local path to trik files |
Environment Variables
| Variable | Description |
|---|---|
NODE_ENV | Set to development for dev registry |
TRIKHUB_REGISTRY | Custom registry URL |
Exit Codes
| Code | Description |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
| 3 | Authentication required |
| 4 | Trik not found |