crates/veilvoice-cli/src/main.rs
veilvoice-cli · 3787 lines · read the source here · or on GitHub
veilvoice, the command-line interface.
Everything VeilVoice does, available without a desktop: it runs over SSH, in a container, and on machines that have no GUI toolkit at all. The same engine backs both this and the graphical app.
What is here
Twenty subcommands, and they divide into five groups:
- Audio --
anonymisea file,livescramble a microphone, listdevices,conversationfor a recording with several people in it. - Privacy of the files themselves --
cleanmetadata,encrypt,decrypt,keygen,shred. - Watching the machine --
watchthe microphone and camera,guardVeilVoice's own files against tampering,sentryfor canaries and how fast a folder is changing,capturefor which screen recorders are running. - The app lock --
lock set|status|change|remove, andpolicyfor settings somebody has fixed so the interface cannot turn them off. - Getting it onto the machine --
install,uninstall,companions, andguito open the desktop application.
That last group is a front end over veilvoice_setup, which the desktop application's setup tab also calls. The careful part -- editing PATH -- has one implementation and one set of tests, rather than one per front end.
Two behaviours that surprise people, on purpose
anonymise writes <out>.veil, not a bare WAV. Recordings are encrypted at rest by default. --encrypt=false opts out and requires --yes, because an unsealed recording is the thing somebody later wishes they had not produced. The wiki explains where the WAV went.
The front-ends refuse rather than downgrade. Asked to encrypt with nothing to encrypt with, this exits with an error instead of writing plain audio and mentioning it. Quiet degradation to a weaker posture is the defect class this project has found in itself most often.
Passphrase prompts cannot be piped
rpassword needs a real console; piping a passphrase in blocks on CONIN$ rather than reading it. That is a property of terminal input, not a bug here, and it means anything that prompts cannot be smoke-tested from a non-interactive shell. The layer beneath each prompt is therefore tested instead -- see crate::atrest and crate::lock, where the logic lives precisely so it can be reached without a terminal.
A clap ordering rule worth knowing
An argument declared beside #[command(subcommand)] must precede the subcommand on the command line unless it is marked global = true. So veilvoice lock --path X status parses and veilvoice lock status --path X does not, except that --path is now global specifically so both do.
In plain words
This is VeilVoice without a window.
Everything the program does, typed instead of clicked: disguise a recording, scramble a microphone while you talk, seal a file, strip a photograph's hidden labels, handle a recording with several people in it.
It is the same code underneath, so it works the same way -- over a remote connection, on a machine with no desktop, or from a script that runs it a thousand times.
WHAT THIS FILE CONTAINS
3787 lines defining 31 functions (0 public), 13 types and 0 constants. Everything below is read out of the source, so it cannot disagree with the code.
The types it owns.
struct Cliline 127 · The whole command line, which is one subcommand and nothing else.enum Commandline 142 · Everything veilvoice can be asked to do.enum FixCommandline 844 · The corrections veilvoice conversation fix can make.enum ConversationCommandline 929 · What veilvoice conversation can be asked to do: read a plan, or render one.enum AppctlCommandline 1087 · What veilvoice capture can do.enum InputCommandline 1120 · What veilvoice input can be asked to do: what is watching input now, or everything this build is able to notice.enum CaptureCommandline 1136 · What veilvoice capture can be asked to do about the microphone and camera, with the same pairing as InputCommand: what is happening now, and what this build is able to notice at all.enum MandateCommandline 1176 · What veilvoice mandate can do.enum PolicyCommandline 1212 · What veilvoice policy can do.enum SentryCommandline 1265 · What veilvoice sentry can do.enum CleanPolicyline 1332 · What to do with the tags in a file veilvoice clean is given.struct Tuningline 2460 · The engine settings a user can reach from the command line.struct AtRestline 2537 · What to do with the result once it exists.
WHAT CALLS WHAT
The functions this file defines, and the calls between them. An edge means the callee's name appears, called, inside the caller's body. This is a syntactic reading, not a type-resolved one. 22 of 30 functions are drawn; the diagram is bounded at 22 so it stays readable.
The same graph as Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#1a1b26","primaryColor":"#1f2335","primaryTextColor":"#c0caf5","primaryBorderColor":"#7aa2f7","secondaryColor":"#16161e","tertiaryColor":"#16161e","lineColor":"#737aa2","textColor":"#c0caf5","mainBkg":"#1f2335","nodeBorder":"#7aa2f7","clusterBkg":"#16161e","clusterBorder":"#2f3549","fontFamily":"ui-monospace, SFMono-Regular, Consolas, monospace","fontSize":"14px"}}}%%
flowchart TD
n_flavour_for["flavour_for<br/>line 1354"]
n_explain_verification["explain_verification<br/>line 1374"]
n_main["main<br/>line 1452"]
n_run["run<br/>line 1494"]
n_run_ffmpeg["run_ffmpeg<br/>line 2112"]
n_list_volumes["list_volumes<br/>line 2187"]
n_list_companions["list_companions<br/>line 2235"]
n_print_launch_check["print_launch_check<br/>line 2279"]
n_say_what_a_video_will_need["say_what_a_video_will_need<br/>line 2331"]
n_offer_line["offer_line<br/>line 2353"]
n_install_companion["install_companion<br/>line 2377"]
n_reseed_range_from["reseed_range_from<br/>line 2479"]
n_config["config<br/>line 2499"]
n_describe_reseed_range["describe_reseed_range<br/>line 2518"]
n_describe_reseed["describe_reseed<br/>line 2528"]
n_anonymise["anonymise<br/>line 2547"]
n_live["live<br/>line 2690"]
n_list_devices["list_devices<br/>line 2922"]
n_read_named["read_named<br/>line 2973"]
n_video_plan["video_plan<br/>line 2988"]
n_write_named["write_named<br/>line 3005"]
n_clean["clean<br/>line 3010"]
n_anonymise --> n_config
n_anonymise --> n_describe_reseed_range
n_clean --> n_read_named
n_describe_reseed_range --> n_describe_reseed
n_install_companion --> n_offer_line
n_list_companions --> n_offer_line
n_list_companions --> n_print_launch_check
n_live --> n_config
n_live --> n_describe_reseed_range
n_main --> n_run
n_print_launch_check --> n_offer_line
n_run --> n_anonymise
n_run --> n_clean
n_run --> n_config
n_run --> n_explain_verification
n_run --> n_flavour_for
n_run --> n_install_companion
n_run --> n_list_companions
n_run --> n_list_devices
n_run --> n_list_volumes
n_run --> n_live
n_run --> n_reseed_range_from
n_run --> n_run_ffmpeg
n_run --> n_say_what_a_video_will_need
n_run --> n_video_plan
click n_flavour_for href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L1354" "open the source"
click n_explain_verification href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L1374" "open the source"
click n_main href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L1452" "open the source"
click n_run href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L1494" "open the source"
click n_run_ffmpeg href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2112" "open the source"
click n_list_volumes href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2187" "open the source"
click n_list_companions href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2235" "open the source"
click n_print_launch_check href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2279" "open the source"
click n_say_what_a_video_will_need href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2331" "open the source"
click n_offer_line href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2353" "open the source"
click n_install_companion href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2377" "open the source"
click n_reseed_range_from href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2479" "open the source"
click n_config href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2499" "open the source"
click n_describe_reseed_range href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2518" "open the source"
click n_describe_reseed href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2528" "open the source"
click n_anonymise href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2547" "open the source"
click n_live href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2690" "open the source"
click n_list_devices href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2922" "open the source"
click n_read_named href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2973" "open the source"
click n_video_plan href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L2988" "open the source"
click n_write_named href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L3005" "open the source"
click n_clean href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-cli/src/main.rs#L3010" "open the source"
classDef helper fill:#1f2335,stroke:#bb9af7,color:#c0caf5
class n_flavour_for,n_explain_verification,n_main,n_run,n_run_ffmpeg,n_list_volumes,n_list_companions,n_print_launch_check,n_say_what_a_video_will_need,n_offer_line,n_install_companion,n_reseed_range_from,n_config,n_describe_reseed_range,n_describe_reseed,n_anonymise,n_live,n_list_devices,n_read_named,n_video_plan,n_write_named,n_clean helper
subgraph chart_key ["Key"]
direction LR
key_helper["helper: private to this file"]
end
class key_helper helper
This site loads no third-party script, so it cannot run Mermaid; the diagram above is the same nodes and edges drawn by the generator instead. GitHub renders the source below directly.
ITEMS
| Item | Line | Documentation |
|---|---|---|
Cli struct | 127 | The whole command line, which is one subcommand and nothing else. |
Command enum | 142 | Everything veilvoice can be asked to do. |
conversation::Fix::from fn | 825 | |
FixCommand enum | 844 | The corrections veilvoice conversation fix can make. |
ConversationCommand enum | 929 | What veilvoice conversation can be asked to do: read a plan, or render one. |
AppctlCommand enum | 1087 | What veilvoice capture can do. |
InputCommand enum | 1120 | What veilvoice input can be asked to do: what is watching input now, or everything this build is able to notice. |
CaptureCommand enum | 1136 | What veilvoice capture can be asked to do about the microphone and camera, with the same pairing as InputCommand: what is happening now, and what this build is able to notice at all. |
MandateCommand enum | 1176 | What veilvoice mandate can do. |
PolicyCommand enum | 1212 | What veilvoice policy can do. |
SentryCommand enum | 1265 | What veilvoice sentry can do. |
CleanPolicy enum | 1332 | What to do with the tags in a file veilvoice clean is given. |
Policy::from fn | 1340 | |
flavour_for fn | 1354 | The verification script's spelling for a system, in one place. |
explain_verification fn | 1374 | What checking a release actually involves, and who does which part. |
main fn | 1452 | Parse the command line and turn a failure into an exit code and a message. |
run fn | 1494 | Carry out one subcommand. |
run_ffmpeg fn | 2112 | Roadmap items 87 and 88. |
list_volumes fn | 2187 | Report the encrypted volumes this machine is offering. |
list_companions fn | 2235 | Report every companion that means anything on this platform. |
print_launch_check fn | 2279 | Roadmap item 163. |
say_what_a_video_will_need fn | 2331 | Roadmap item 163. |
offer_line fn | 2353 | One line describing what VeilVoice can do about a missing companion. |
install_companion fn | 2377 | Act on one named companion. |
Tuning struct | 2460 | The engine settings a user can reach from the command line. |
reseed_range_from fn | 2479 | Turn --reseed-range into a range, or into the reason it was not one. |
config fn | 2499 | The de-identification settings a Tuning describes, with every figure clamped. |
describe_reseed_range fn | 2518 | How a randomised roll range reads in the output. |
describe_reseed fn | 2528 | How the seed-rolling setting reads in the output. |
AtRest struct | 2537 | What to do with the result once it exists. |
anonymise fn | 2547 | veilvoice anonymise: veil a recording and write it somewhere else. |
live fn | 2690 | veilvoice live: veil the microphone as it is heard, with an optional preview. |
list_devices fn | 2922 | veilvoice devices: every input and output this machine reports. |
read_named pub(crate) fn | 2973 | Read a file, naming it if that fails. |
video_plan pub(crate) fn | 2988 | Read a --size and an --fps into a render plan, saying what was decided. |
write_named pub(crate) fn | 3005 | Write a file, naming it if that fails. |
clean fn | 3010 | veilvoice clean: strip the metadata a file carries, in place. |
encrypt fn | 3028 | veilvoice encrypt: seal a file, to a passphrase or to a public key. |
decrypt fn | 3059 | veilvoice decrypt: open a sealed file, given the passphrase or the secret key. |
load_secret_key fn | 3091 | Load a private key file, which is itself a password-locked container. |
keygen fn | 3101 | veilvoice keygen: write a new key pair, refusing to overwrite either file. |
watch fn | 3177 | Report, and keep reporting, what is using the microphone and camera. |
shred fn | 3267 | Destroy a file's contents, then delete it. |
info fn | 3336 | veilvoice info: the versions, and what this build was compiled to do. |