CLI API¶
Command-line interface implementation.
cli¶
Main CLI entrypoint and command definitions.
cli
¶
Axium CLI - Main command-line interface.
This module provides the Typer-based CLI for Axium, including daemon management, environment controls, command execution with prefix wrapping, HUD status display, and interactive palette.
The CLI automatically bootstraps configuration on first run and loads any installed Spokes to extend functionality.
HelpfulGroup
¶
Bases: TyperGroup
Custom Typer group that shows full help on invalid commands.
When a user mistypes a command, instead of just showing an error, displays the full command list to guide them to the correct command.
This improves CLI usability by making Axium self-documenting and reducing friction when users make typos.
Source code in axium/core/cli.py
resolve_command(ctx, args)
¶
Override resolve_command to show help on command not found.
This is called by Click to resolve which command to run. If the command is not found, we print an error, show help, and exit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
Click context containing app state and configuration |
required |
args
|
list[str]
|
Command-line arguments to resolve |
required |
Returns:
| Type | Description |
|---|---|
tuple[str | None, Command | None, list[str]]
|
Tuple of (command_name, command_object, remaining_args) |
Raises:
| Type | Description |
|---|---|
UsageError
|
For errors other than command not found |
Source code in axium/core/cli.py
is_verbose()
¶
Check if verbose mode is enabled.
Returns:
| Type | Description |
|---|---|
bool
|
True if --verbose flag was passed, False otherwise |
Source code in axium/core/cli.py
info()
¶
Display Axium information and tagline.
help()
¶
Show unified help with all commands grouped by category.
Displays all available commands from core, spokes, and gears in a structured, categorized format.
Example
Note
This replaces the need to run --help on each command group.
For detailed help on a specific command, use:
axium
Source code in axium/core/cli.py
discover()
¶
Show installed components and configuration.
Displays: - Configured environments - Installed spokes - Installed gears - Active wrappers
Useful for understanding what's available in your Axium installation.
Example
Note
Use 'axium help' to see all available commands.
Source code in axium/core/cli.py
doctor()
¶
Check Axium configuration and system health.
Runs diagnostics on: - Config directory structure - Daemon connectivity - Environment definitions - Spoke/gear loading - File permissions - Shell integration
Provides actionable fix suggestions for any issues found.
Example
$ axium doctor
Axium Health Check
✓ Config directory: /Users/user/.config/axium
✓ Daemon running: PID 12345
✓ IPC socket: Accessible
✓ Environments: 3 configured
✓ Spokes: 2 installed, 2 active
✓ Gears: 1 installed
✗ Shell integration: Not detected
→ Add to ~/.bashrc: source ~/.config/axium/bash/init.sh
Overall: 6/7 checks passed
Note
Run this command if you're experiencing issues with Axium. All checks are read-only and safe to run repeatedly.
Source code in axium/core/cli.py
completions_list_cmd(shell=typer.Option('zsh', '--shell', help='Shell type (zsh, bash, fish)'), prefix=typer.Argument('', help='Prefix to filter completions'))
¶
List matching completions for shell integration.
Used by shell completion functions to get matching commands. Returns one command per line for easy parsing by shell scripts.
The completion cache is automatically regenerated when: - Spokes are loaded, reloaded, or unloaded - Gears are loaded or unloaded - Daemon configuration is reloaded
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shell
|
str
|
Shell type (zsh, bash, fish) - currently all use same format |
Option('zsh', '--shell', help='Shell type (zsh, bash, fish)')
|
prefix
|
str
|
Command prefix to match (e.g., "env", "daemon s") |
Argument('', help='Prefix to filter completions')
|
Example
Performance
Target response time: <50ms including cache load and filtering
Usage in shell
Note
If the cache doesn't exist, returns empty list. Cache is regenerated automatically by the daemon on command structure changes.
Source code in axium/core/cli.py
completions_install_cmd(shell=typer.Option(None, '--shell', help='Shell type (auto-detect if not specified)'))
¶
Print shell completion setup instructions.
Outputs the completion script to add to your shell configuration file. Auto-detects shell from $SHELL environment variable if not specified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shell
|
str
|
Shell type (zsh, bash, fish). Auto-detected if omitted. |
Option(None, '--shell', help='Shell type (auto-detect if not specified)')
|
Example
Supported Shells
- zsh: Fast completion using compadd
- bash: Completion using complete -F
- fish: Completion using complete -c
Note
After adding the script to your shell config, reload it with: - zsh: source ~/.zshrc - bash: source ~/.bashrc - fish: Completions work immediately after file creation
Source code in axium/core/cli.py
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 | |
completions_refresh_cmd()
¶
Regenerate completion cache immediately.
Forces regeneration of ~/.config/axium/completions.json from the current command registry. Normally the cache is regenerated automatically when spokes load/reload, so manual refresh is rarely needed.
Use this command after:
- Manually editing spoke files
- Installing spokes outside of axium spoke install
- Debugging completion issues
Example
Performance
Typically completes in <20ms with 100+ commands
Note
This command requires all spokes to be loaded, so it may trigger spoke loading if not already done. The daemon performs automatic regeneration, so manual refresh is usually unnecessary.
Source code in axium/core/cli.py
wrapper_list_cmd()
¶
List all currently wrapped commands.
Shows commands that have prefix rules configured in prefixes.yaml. These commands will be intercepted by shell wrapper functions that call 'axium run' to apply environment-specific prefixes.
Note
This reads from ~/.config/axium/state_cache.json which is
automatically updated when:
- Daemon starts
- axium daemon reload is run
- Prefix rules in prefixes.yaml change
Source code in axium/core/cli.py
wrapper_refresh_cmd()
¶
Print shell commands to refresh wrappers in current shell.
Outputs bash/zsh code that clears old wrapper functions and regenerates them from the latest state_cache.json. Run this after modifying prefixes.yaml and reloading the daemon.
Example
Usage
The output must be eval'd to take effect in your current shell. Simply running this command will only print the code, not execute it.
What it does
- Unsets all previously wrapped command functions
- Reads latest wrapped commands from state_cache.json
- Creates new wrapper functions for each command
Note
This requires Axium shell integration to be loaded (i.e., bash/init.sh must be sourced in your shell config).
Source code in axium/core/cli.py
wrapper_clear_cmd()
¶
Print shell commands to remove all wrapper functions.
Outputs bash/zsh code that unsets all wrapper functions, restoring original command behavior. Useful for debugging or temporarily disabling Axium's command wrapping.
Example
Usage
The output must be eval'd to take effect in your current shell.
What it does
Unsets all tracked wrapper functions (from $AXIUM_WRAPPED_COMMANDS), allowing you to call the original commands directly.
Note
To re-enable wrappers after clearing, run: $ eval "$(axium wrapper refresh)"
Source code in axium/core/cli.py
bootstrap(force=typer.Option(False, '--force', '-f', help='Force update shell integration scripts (bash/init.sh, tmux/init.sh)'))
¶
Initialize or update Axium configuration.
Creates ~/.config/axium/ with default configuration files if missing. Use --force to update shell integration scripts even if they exist.
Silent on success (use --verbose for details), shows errors only.
Example
Note
User config files (envs.yaml, prefixes.yaml, state.json) are never overwritten, even with --force.
Source code in axium/core/cli.py
spoke_new(name=typer.Argument(..., help='Name of the new spoke (lowercase, no spaces)'), description=typer.Option(None, '--description', '-d', help='Short description of the spoke'), version=typer.Option('0.1.0', '--version', '-v', help='Initial version'), interactive=typer.Option(True, '--interactive/--no-interactive', help='Prompt for values interactively'))
¶
Create a new Spoke with scaffolded structure.
Generates a new Spoke directory in ~/.config/axium/spokes/
Example
Source code in axium/core/cli.py
spoke_install(source=typer.Argument(..., help='Source path (local path, git URL, or registry name)'), editable=typer.Option(False, '--editable', '-e', help='Install as symlink for development'), name=typer.Option(None, '--name', '-n', help='Override spoke name'))
¶
Install a Spoke from source.
Supports: - Local paths: /path/to/my-spoke or ~/spokes/my-spoke - Git URLs: git+https://github.com/user/spoke.git (future) - Registry: my-spoke (future)
Installation modes:
- Normal (copy): Copies spoke to ~/.config/axium/spokes/
Example
Source code in axium/core/cli.py
spoke_reinstall(name=typer.Argument(..., help='Spoke name to reinstall'))
¶
Reinstall a spoke from its original source.
Preserves the installation mode (copy/symlink) and reinstalls from the original source location. Useful for updating spokes or fixing installation issues.
Example
Source code in axium/core/cli.py
848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 | |
spoke_list()
¶
List all installed Spokes with metadata.
Displays: - Spoke name and version - Description - Installation mode (copy/symlink) - Load status (active/error/not-loaded) - Last loaded timestamp
Example
Source code in axium/core/cli.py
spoke_reload(name=typer.Argument(None, help='Spoke name to reload (omit to reload all)'))
¶
Reload spoke(s) without restarting daemon.
Dynamically reloads spoke code and re-registers commands. Useful during development to test changes immediately.
Example
Source code in axium/core/cli.py
perms_list()
¶
List all spokes with their effective permissions.
Displays a table showing: - Spoke name - exec permission (✓ or ✗) - notify permission (✓ or ✗) - net permission (✓ or ✗) - fs_read count - fs_write count
Example
Source code in axium/core/cli.py
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 | |
perms_show(spoke=typer.Argument(..., help='Spoke name'))
¶
Show detailed permissions for a spoke.
Displays: - All permission fields with values - Source annotation (base/override/default) - Full list of fs_read and fs_write patterns
Example
Source code in axium/core/cli.py
1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 | |
perms_edit(spoke=typer.Argument(..., help='Spoke name'))
¶
Edit user permission overrides for a spoke.
Opens ~/.config/axium/permissions.yaml in $EDITOR. If file doesn't exist, prints example configuration to create.
Example
Source code in axium/core/cli.py
gear_list()
¶
List all installed Gears with metadata.
Displays: - Gear name and version - Description - Installation mode (copy/symlink) - Load status (active/error/not-loaded) - Last loaded timestamp
Example
Source code in axium/core/cli.py
gear_install(source=typer.Argument(..., help='Source path (local directory)'), editable=typer.Option(False, '--editable', '-e', help='Install as symlink for development'), name=typer.Option(None, '--name', '-n', help='Override gear name'))
¶
Install a Gear from source.
Supports local directory paths. Gears are privileged extensions
installed to ~/.config/axium/gears/
Installation modes: - Normal (copy): Copies gear files - Editable (symlink): Creates symlink for live development
Example
Source code in axium/core/cli.py
gear_reinstall(name=typer.Argument(..., help='Gear name to reinstall'))
¶
Reinstall a gear from its original source.
Preserves the installation mode (copy/symlink) and reinstalls from the original source location. Useful for updating gears or fixing installation issues.
Example
Source code in axium/core/cli.py
1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 | |
gear_uninstall(name=typer.Argument(..., help='Gear name to uninstall'), force=typer.Option(False, '--force', '-f', help='Skip confirmation'))
¶
Uninstall a Gear.
Removes the gear directory and cleans up metadata and permission overrides.
Example
Source code in axium/core/cli.py
gear_reload(name=typer.Argument(None, help='Gear name to reload (omit to reload all)'))
¶
Reload gear(s) without restarting daemon.
Dynamically reloads gear code and re-registers commands. Useful during development to test changes immediately.
Example
Source code in axium/core/cli.py
gear_perms_show(gear=typer.Argument(..., help='Gear name'))
¶
Show effective permissions for a gear.
Displays base permissions from gear.yaml merged with user overrides
from overrides/permissions/
Example
Source code in axium/core/cli.py
1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 | |
gear_perms_edit(gear=typer.Argument(..., help='Gear name'))
¶
Edit user permission overrides for a gear.
Opens ~/.config/axium/overrides/permissions/
Example
Source code in axium/core/cli.py
1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 | |
notify_drain()
¶
Print and clear queued notifications.
Retrieves all notifications from the daemon's queue and clears it. Useful for checking notifications emitted by spokes.
Example
Source code in axium/core/cli.py
notify_send(title=typer.Option(..., '--title', '-t', help='Notification title'), body=typer.Option('', '--body', '-b', help='Notification body'), level=typer.Option('info', '--level', '-l', help='Notification level'))
¶
Send test notification via daemon.
Sends notification using "core" fake spoke identity for testing. Requires notify permission (granted by default for core).
Example
Source code in axium/core/cli.py
notify_list()
¶
List queued notifications without clearing them.
Non-destructive read of notification queue. Use 'axium notify drain' to list and clear in one operation.
Example
Source code in axium/core/cli.py
notify_clear()
¶
Clear all queued notifications.
Silent on success (follows silent-core pattern). Use --verbose to see confirmation message.
Example
Source code in axium/core/cli.py
config_path(spoke=typer.Argument(..., help="Spoke name (e.g., 'creds')"))
¶
Show configuration file paths for a spoke.
Displays the base config path (bundled with spoke) and override path (in ~/.config/axium/overrides/). Indicates which files exist.
Example
Source code in axium/core/cli.py
config_show(spoke=typer.Argument(..., help="Spoke name (e.g., 'creds')"), key=typer.Option(None, '--key', '-k', help="Show specific key path (e.g., 'check.path')"), redact=typer.Option(False, '--redact', help='Mask sensitive values (passwords, tokens, keys)'))
¶
Display merged configuration for a spoke via daemon.
Shows the final merged configuration (base + override + environment) loaded and cached by the daemon. Uses IPC to query the daemon.
Example
$ axium config show creds
Merged Configuration (creds):
{
"check": {
"type": "mtime",
"path": "/home/user/.aws/credentials"
}
}
$ axium config show creds --key check.path
Merged Configuration (creds, key: check.path):
/home/user/.aws/credentials
$ axium config show creds --redact
Merged Configuration (creds):
{
"api_key": "***REDACTED***",
"check": { ... }
}
Source code in axium/core/cli.py
1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 | |
config_edit(spoke=typer.Argument(..., help="Spoke name (e.g., 'creds')"))
¶
Open override configuration in editor.
Opens ~/.config/axium/overrides/
The override file starts empty - add only the values you want to override from the base configuration.
Example
Note
Set EDITOR environment variable to use your preferred editor. Falls back to vim if EDITOR is not set.
Source code in axium/core/cli.py
daemon_start(debug=typer.Option(False, '--debug', help='Run in foreground with logs to stdout'))
¶
Start the Axium daemon process.
The daemon manages state, handles IPC requests, and coordinates events. By default, starts as a background process with logs to ~/.config/axium/axiumd.log.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
debug
|
bool
|
If True, run in foreground with logs to stdout (for development) |
Option(False, '--debug', help='Run in foreground with logs to stdout')
|
Example
Source code in axium/core/cli.py
daemon_stop()
¶
Stop the Axium daemon process.
Sends a stop command via IPC. If daemon is unresponsive, attempts to send SIGTERM to the PID from ~/.config/axium/axiumd.pid.
Source code in axium/core/cli.py
daemon_status()
¶
Check daemon status and liveness.
Displays PID, socket path, and whether the daemon responds to ping.
Example
Source code in axium/core/cli.py
daemon_logs(follow=typer.Option(False, '--follow', '-f', help='Follow log output (tail -f)'), lines=typer.Option(50, '--lines', '-n', help='Number of lines to show'))
¶
View daemon logs from ~/.config/axium/axiumd.log.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
follow
|
bool
|
If True, continuously tail the log file (like tail -f) |
Option(False, '--follow', '-f', help='Follow log output (tail -f)')
|
lines
|
int
|
Number of lines to display (default: 50) |
Option(50, '--lines', '-n', help='Number of lines to show')
|
Example
Raises:
| Type | Description |
|---|---|
Exit
|
If log file doesn't exist or can't be read |
Source code in axium/core/cli.py
daemon_reload()
¶
Reload daemon state from disk.
Forces the daemon to re-read state.json and refresh its internal state. Useful after manually editing configuration files.
Note
Requires daemon to be running. Does not reload Spokes (restart required).
Source code in axium/core/cli.py
daemon_restart()
¶
Restart the Axium daemon process.
Stops the daemon gracefully, waits for clean shutdown, then starts it again. This is equivalent to running 'axium daemon stop' followed by 'axium daemon start', but handles the timing automatically.
Use this when you need to: - Apply configuration changes that require a full restart - Reset daemon state completely - Recover from daemon issues
Example
Note
This will reset daemon uptime and reload all spokes/gears. For config-only changes, use 'axium daemon reload' instead.
Source code in axium/core/cli.py
env_set(name)
¶
Set the active environment.
Updates daemon state and triggers env_change events for Spokes to react. The environment must exist in ~/.config/axium/envs.yaml.
In tmux: Sets environment for current pane and exports AXIUM_ENV to pane. Outside tmux: Sets global environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Environment name from envs.yaml (e.g., "prod", "dev", "staging") |
required |
Example
Note
Requires daemon to be running. Emits env_change event to all Spokes.
In tmux, also calls 'tmux setenv -t
Source code in axium/core/cli.py
env_get(pane=typer.Option(None, '--pane', help='Get environment for specific pane ID (e.g., %1)'))
¶
Get the active environment name.
In tmux: Queries daemon for current pane's environment. Outside tmux: Queries daemon for global active_env.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pane
|
str | None
|
Optional pane ID to query. If None, uses TMUX_PANE or global. |
Option(None, '--pane', help='Get environment for specific pane ID (e.g., %1)')
|
Example
Note
Requires daemon to be running. Returns None if no environment is set.
Source code in axium/core/cli.py
env_list(show_panes=typer.Option(False, '--panes', help='Show per-pane environment mappings'))
¶
List all available environments from envs.yaml.
Displays all defined environments with their property keys. The active environment is marked with *.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
show_panes
|
bool
|
If True, also displays pane-to-environment mappings from daemon |
Option(False, '--panes', help='Show per-pane environment mappings')
|
Example
$ axium env list
Available environments:
* prod (prefix, aws_profile, region, color)
dev (prefix, aws_profile, region, color)
staging (prefix, region)
$ axium env list --panes
Available environments:
* prod (prefix, aws_profile, region, color)
dev (prefix, aws_profile, region, color)
Pane Mappings:
%1 → root
%2 → builder
%3 → prod
Note
Reads directly from ~/.config/axium/envs.yaml (no daemon required). --panes requires daemon to be running.
Source code in axium/core/cli.py
2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 | |
env_show(name=typer.Argument(None))
¶
Show properties for an environment.
Displays all key-value pairs for the specified environment. If no name is provided, shows the active environment (checking pane-specific environment in tmux, then falling back to global).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Optional environment name. If None, uses active environment. |
Argument(None)
|
Example
Note
Reads from ~/.config/axium/envs.yaml for properties. Queries daemon for active environment (pane-specific or global).
Source code in axium/core/cli.py
2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 | |
run_cmd(ctx, command)
¶
Execute a command with registered prefix rules applied.
This is the core of Axium's command wrapping. If the command has a prefix rule in prefixes.yaml, the prefix is applied based on the current context (environment, tmux pane, etc.).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
Typer context for accessing extra arguments |
required |
command
|
str
|
Command to execute (e.g., "aws", "terraform") |
required |
Example
$ axium run aws s3 ls
# If active env is 'prod' with prefix 'enva-prod':
# Actually executes: enva-prod aws s3 ls
$ axium run terraform plan
# With prefix rules, becomes: enva-prod terraform plan
$ axium run aws s3 cp --recursive mydir s3://bucket/
# External flags like --recursive are passed through transparently
Note
- Falls back to unwrapped command if daemon unreachable
- Falls back to unwrapped if prefix command not found
- Exits with same return code as the executed command
- Context includes: TMUX_PANE, active_env
- All arguments after command are passed through without parsing
Source code in axium/core/cli.py
2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 | |
hud_callback(ctx, pane=typer.Option(None, '--pane', help='Show HUD for specific pane ID (e.g., %1)'))
¶
Display HUD status line for tmux/shell prompts.
Generates a one-line status display showing environment, uptime, and other context. Designed to be called from tmux status line or shell prompt.
Uses fast path (cached HUD from daemon) when --pane is specified for instant response times suitable for frequent tmux refreshes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pane
|
str | None
|
Optional pane ID to show pane-specific environment context |
Option(None, '--pane', help='Show HUD for specific pane ID (e.g., %1)')
|
Example
Usage in tmux.conf:
Note
Gracefully handles daemon being down (shows "inactive"). Output format suitable for tmux status-right or PS1. In tmux, #D expands to the pane ID (e.g., %1). Fast path bypasses spoke providers for instant response.
Source code in axium/core/cli.py
2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 | |
hud_reload_cmd()
¶
Reload HUD configuration and refresh all panes.
Forces the daemon to reload hud.yaml and regenerate HUD cache for all active panes. Use this after modifying hud.yaml to apply changes.
Note
Requires daemon to be running. Returns exit code 1 if reload fails.
Source code in axium/core/cli.py
hud_theme_cmd(action=typer.Argument(..., help='Action: list, show, set <name>'), theme_name=typer.Argument(None, help="Theme name for 'set' action"))
¶
Manage HUD color themes.
Themes provide customizable color schemes for HUD output. Themes are disabled by default and can be enabled by setting a theme in hud.yaml.
Available themes
- classic: Standard ANSI colors (white, cyan, yellow, red, green)
- teal: Axium brand colors (#00B7C7 teal, soft white)
- dim: Dimmed colors for low-contrast terminals
- inverted: Dark colors for light backgrounds
- mono: No colors (plain text)
- soft: Pastel colors for gentle aesthetics
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
str
|
Action to perform (list, show, set) |
Argument(..., help='Action: list, show, set <name>')
|
theme_name
|
str | None
|
Theme name when using 'set' action |
Argument(None, help="Theme name for 'set' action")
|
Example
Note
Themes are opt-in to preserve Axium's silent design philosophy. Edit ~/.config/axium/hud.yaml to manually enable/disable themes.
Source code in axium/core/cli.py
2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 | |
palette_cmd(reload=typer.Option(False, '--reload', help='Reload Spokes and refresh command list'))
¶
Launch the interactive palette TUI.
Opens a curses-based menu for quick access to all Axium commands (core and Spokes). Commands are discovered dynamically from the command registry. Navigate with arrow keys or j/k, select with Enter, quit with q/Esc.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reload
|
bool
|
Force reload of Spokes and refresh command registry |
Option(False, '--reload', help='Reload Spokes and refresh command list')
|
Example
Note
Requires terminal with curses support. Commands execute in foreground, press Enter after completion to return to palette.
Source code in axium/core/cli.py
main()
¶
CLI entrypoint.
Called when axium is invoked from the command line (via setup.py entry point). Initializes Typer app and processes commands.