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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//! CLI argument definitions.
use clap::{Parser, Subcommand};
use std::path::PathBuf;
/// FalseGreen client — independent verification for coding agents.
#[derive(Parser, Debug)]
#[command(name = "falsegreen", version, about, long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
/// Run the MCP server over STDIO (launched by Codex).
Mcp,
/// Log in to FalseGreen and store credentials.
Login {
/// Enrollment credential (if omitted, you will be prompted).
#[arg(long)]
token: Option<String>,
},
/// Log out and remove stored credentials.
Logout,
/// Show current authentication and configuration status.
Status,
/// Inspect and advance a controller-owned Terraform/IaC verification.
Terraform {
#[command(subcommand)]
command: TerraformCommands,
},
/// Install FalseGreen into an agent's MCP configuration.
Install {
/// Which agent to install into.
#[arg(value_enum)]
agent: AgentTarget,
},
}
#[derive(Subcommand, Debug)]
pub enum TerraformCommands {
/// Show plan, authorization, and deployed-outcome state without mutation.
Inspect {
#[arg(long)]
task_id: String,
#[arg(long)]
run_id: String,
#[arg(long)]
command_index: Option<u64>,
},
/// Emit the exact bounded payload required for enforced human signing.
AuthorizationPayload {
#[arg(long)]
task_id: String,
#[arg(long)]
run_id: String,
#[arg(long)]
command_index: Option<u64>,
#[arg(long)]
valid_for_seconds: Option<u64>,
},
/// Explicitly authorize one use of the exact accepted plan.
Authorize {
#[arg(long)]
task_id: String,
#[arg(long)]
run_id: String,
#[arg(long)]
actor: String,
#[arg(long)]
confirm: bool,
#[arg(long)]
command_index: Option<u64>,
#[arg(long)]
valid_for_seconds: Option<u64>,
#[arg(long)]
approval_file: Option<PathBuf>,
},
/// Consume a backend authorization and apply only its exact saved plan.
Apply {
#[arg(long)]
task_id: String,
#[arg(long)]
run_id: String,
#[arg(long)]
authorization_id: String,
#[arg(long)]
command_index: Option<u64>,
},
/// Independently refresh and observe the already applied outcome.
VerifyDeployed {
#[arg(long)]
task_id: String,
#[arg(long)]
run_id: String,
#[arg(long)]
command_index: Option<u64>,
},
}
#[derive(clap::ValueEnum, Clone, Debug)]
pub enum AgentTarget {
/// Codex CLI (~/.codex/config.toml, STDIO launch).
Codex,
/// GitHub Copilot in VS Code (.vscode/mcp.json, local STDIO).
#[value(name = "github-copilot")]
GithubCopilot,
/// Claude Code (.mcp.json, local STDIO).
#[value(name = "claude-code")]
ClaudeCode,
/// OpenCode (opencode.json, local STDIO).
#[value(name = "opencode")]
OpenCode,
/// Cursor (.cursor/mcp.json, local STDIO).
Cursor,
}