1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(
name = "starfire",
about = "Starfire — CLI router and tool manager",
long_about = "Manage API keys and run CLI tools with credentials automatically injected."
)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// List supported CLI tools and their status
List,
/// Manage API keys and tokens
Auth {
#[command(subcommand)]
action: AuthAction,
},
/// Register an API key/token for a tool (e.g. starfire register cloudflare <token>)
Register {
/// Tool name (e.g. cloudflare, railway, fal)
tool: String,
/// API key or PAT token
token: String,
},
/// Show AI agent skill file for starfire or a specific tool
Skill {
/// Tool name (omit for the main starfire skill)
tool: Option<String>,
},
/// Run an installed tool with stored credentials injected
Run {
/// Name of the tool to run
tool: String,
/// Arguments to pass to the tool
#[arg(trailing_var_arg = true, allow_hyphen_values = true)]
args: Vec<String>,
},
}
#[derive(Subcommand)]
pub enum AuthAction {
/// Store an API key or token for a tool
Set {
/// Tool name
tool: String,
/// API key or token value
key: String,
},
/// Retrieve the stored key for a tool (masked by default for AI safety)
Get {
/// Tool name
tool: String,
/// Show the full unmasked key (default: masked to prevent AI agent exposure)
#[arg(long)]
unmask: bool,
},
/// List all stored credentials (names only, values are masked)
List,
/// Remove a stored credential
Remove {
/// Tool name
tool: String,
},
}