1pub const FAILED_TO_SAVE: &str = "Failed to save";
11pub fn failed_to_save(e: &impl std::fmt::Display) -> String {
12 format!("{}: {}", FAILED_TO_SAVE, e)
13}
14
15pub const CONFIG_CHANGED_EXTERNALLY: &str =
16 "Config changed externally. Press Esc and re-open to pick up changes.";
17
18pub const DEMO_CONNECTION_DISABLED: &str = "Demo mode. Connection disabled.";
21pub const DEMO_SYNC_DISABLED: &str = "Demo mode. Sync disabled.";
22pub const DEMO_TUNNELS_DISABLED: &str = "Demo mode. Tunnels disabled.";
23pub const DEMO_VAULT_SIGNING_DISABLED: &str = "Demo mode. Vault SSH signing disabled.";
24pub const DEMO_FILE_BROWSER_DISABLED: &str = "Demo mode. File browser disabled.";
25pub const DEMO_CONTAINER_REFRESH_DISABLED: &str = "Demo mode. Container refresh disabled.";
26pub const DEMO_CONTAINER_ACTIONS_DISABLED: &str = "Demo mode. Container actions disabled.";
27pub const DEMO_EXECUTION_DISABLED: &str = "Demo mode. Execution disabled.";
28pub const DEMO_PROVIDER_CHANGES_DISABLED: &str = "Demo mode. Provider config changes disabled.";
29
30pub fn stale_host(hint: &str) -> String {
33 format!("Stale host.{}", hint)
34}
35
36pub fn copied_ssh_command(alias: &str) -> String {
39 format!("Copied SSH command for {}.", alias)
40}
41
42pub fn copied_config_block(alias: &str) -> String {
43 format!("Copied config block for {}.", alias)
44}
45
46pub fn showing_unreachable(count: usize) -> String {
47 format!(
48 "Showing {} unreachable host{}.",
49 count,
50 if count == 1 { "" } else { "s" }
51 )
52}
53
54pub fn sorted_by(label: &str) -> String {
55 format!("Sorted by {}.", label)
56}
57
58pub fn sorted_by_save_failed(label: &str, e: &impl std::fmt::Display) -> String {
59 format!("Sorted by {}. (save failed: {})", label, e)
60}
61
62pub fn grouped_by(label: &str) -> String {
63 format!("Grouped by {}.", label)
64}
65
66pub fn grouped_by_save_failed(label: &str, e: &impl std::fmt::Display) -> String {
67 format!("Grouped by {}. (save failed: {})", label, e)
68}
69
70pub const UNGROUPED: &str = "Ungrouped.";
71
72pub fn ungrouped_save_failed(e: &impl std::fmt::Display) -> String {
73 format!("Ungrouped. (save failed: {})", e)
74}
75
76pub const GROUPED_BY_TAG: &str = "Grouped by tag.";
77
78pub fn grouped_by_tag_save_failed(e: &impl std::fmt::Display) -> String {
79 format!("Grouped by tag. (save failed: {})", e)
80}
81
82pub fn host_restored(alias: &str) -> String {
83 format!("{} is back from the dead.", alias)
84}
85
86pub fn restored_tags(count: usize) -> String {
87 format!(
88 "Restored tags on {} host{}.",
89 count,
90 if count == 1 { "" } else { "s" }
91 )
92}
93
94pub const NOTHING_TO_UNDO: &str = "Nothing to undo.";
95pub const NO_IMPORTABLE_HOSTS: &str = "No importable hosts in known_hosts.";
96pub const NO_STALE_HOSTS: &str = "No stale hosts.";
97pub const NO_HOST_SELECTED: &str = "No host selected.";
98pub const NO_HOSTS_TO_RUN: &str = "No hosts to run on.";
99pub const NO_HOSTS_TO_TAG: &str = "No hosts to tag.";
100pub const PING_FIRST: &str = "Ping first (p/P), then filter with !.";
101pub const PINGING_ALL: &str = "Pinging all the things...";
102
103pub fn included_file_edit(name: &str) -> String {
104 format!("{} is in an included file. Edit it there.", name)
105}
106
107pub fn included_file_delete(name: &str) -> String {
108 format!("{} is in an included file. Delete it there.", name)
109}
110
111pub fn included_file_clone(name: &str) -> String {
112 format!("{} is in an included file. Clone it there.", name)
113}
114
115pub fn included_host_lives_in(alias: &str, path: &impl std::fmt::Display) -> String {
116 format!("{} lives in {}. Edit it there.", alias, path)
117}
118
119pub fn included_host_clone_there(alias: &str, path: &impl std::fmt::Display) -> String {
120 format!("{} lives in {}. Clone it there.", alias, path)
121}
122
123pub fn included_host_tag_there(alias: &str, path: &impl std::fmt::Display) -> String {
124 format!("{} is included from {}. Tag it there.", alias, path)
125}
126
127pub const HOST_NOT_FOUND_IN_CONFIG: &str = "Host not found in config.";
128
129pub const SMART_PARSED: &str = "Smart-parsed that for you. Check the fields.";
132pub const LOOKS_LIKE_ADDRESS: &str = "Looks like an address. Suggested as Host.";
133
134pub fn goodbye_host(alias: &str) -> String {
137 format!("Goodbye, {}. We barely knew ye. (u to undo)", alias)
138}
139
140pub fn host_not_found(alias: &str) -> String {
141 format!("Host '{}' not found.", alias)
142}
143
144pub fn siblings_stripped(alias: &str, sibling_count: usize) -> String {
148 if sibling_count == 1 {
149 format!(
150 "Stripped {}. 1 sibling alias kept its shared config.",
151 alias
152 )
153 } else {
154 format!(
155 "Stripped {}. {} sibling aliases kept their shared config.",
156 alias, sibling_count
157 )
158 }
159}
160
161pub fn confirm_delete_siblings_note(siblings: &[String]) -> String {
165 let shown: Vec<&str> = siblings.iter().take(3).map(String::as_str).collect();
166 let tail = if siblings.len() > shown.len() {
167 format!(" +{} more", siblings.len() - shown.len())
168 } else {
169 String::new()
170 };
171 format!("Siblings kept: {}{}", shown.join(", "), tail)
172}
173
174pub fn cert_cleanup_warning(path: &impl std::fmt::Display, e: &impl std::fmt::Display) -> String {
175 format!("Warning: failed to clean up Vault SSH cert {}: {}", path, e)
176}
177
178pub const CLONED_VAULT_CLEARED: &str = "Cloned. Vault SSH role cleared on copy.";
181
182pub const TUNNEL_REMOVED: &str = "Tunnel removed.";
185pub const TUNNEL_SAVED: &str = "Tunnel saved.";
186pub const TUNNEL_NOT_FOUND: &str = "Tunnel not found in config.";
187pub const TUNNEL_INCLUDED_READ_ONLY: &str = "Included host. Tunnels are read-only.";
188pub const TUNNEL_ORIGINAL_NOT_FOUND: &str = "Original tunnel not found in config.";
189pub const TUNNEL_LIST_CHANGED: &str = "Tunnel list changed externally. Press Esc and re-open.";
190pub const TUNNEL_DUPLICATE: &str = "Duplicate tunnel already configured.";
191pub const TUNNEL_NO_EDITABLE_HOSTS: &str = "No editable hosts. Add a host first.";
192pub const TUNNEL_HOST_PICKER_NO_MATCH: &str = "No matches.";
193
194pub fn tunnel_stopped(alias: &str) -> String {
195 format!("Tunnel for {} stopped.", alias)
196}
197
198pub fn tunnel_started(alias: &str) -> String {
199 format!("Tunnel for {} started.", alias)
200}
201
202pub fn tunnel_start_failed(e: &impl std::fmt::Display) -> String {
203 format!("Failed to start tunnel: {}", e)
204}
205
206pub fn pinging_host(alias: &str, show_hint: bool) -> String {
209 if show_hint {
210 format!("Pinging {}... (Shift+P pings all)", alias)
211 } else {
212 format!("Pinging {}...", alias)
213 }
214}
215
216pub fn bastion_not_found(alias: &str) -> String {
217 format!("Bastion {} not found in config.", alias)
218}
219
220pub fn provider_removed(display_name: &str) -> String {
223 format!(
224 "Removed {} configuration. Synced hosts remain in your SSH config.",
225 display_name
226 )
227}
228
229pub fn provider_not_configured(display_name: &str) -> String {
230 format!("{} is not configured. Nothing to remove.", display_name)
231}
232
233pub fn provider_configure_first(display_name: &str) -> String {
234 format!("Configure {} first. Press Enter to set up.", display_name)
235}
236
237pub fn provider_saved_syncing(display_name: &str) -> String {
238 format!("Saved {} configuration. Syncing...", display_name)
239}
240
241pub fn provider_saved(display_name: &str) -> String {
242 format!("Saved {} configuration.", display_name)
243}
244
245pub fn no_stale_hosts_for(display_name: &str) -> String {
246 format!("No stale hosts for {}.", display_name)
247}
248
249pub fn contains_control_chars(name: &str) -> String {
250 format!("{} contains control characters.", name)
251}
252
253pub const TOKEN_FORMAT_AWS: &str = "Token format: AccessKeyId:SecretAccessKey";
254pub const URL_REQUIRED_PROXMOX: &str = "URL is required for Proxmox VE.";
255pub const PROJECT_REQUIRED_GCP: &str = "Project ID can't be empty. Set your GCP project ID.";
256pub const COMPARTMENT_REQUIRED_OCI: &str =
257 "Compartment can't be empty. Set your OCI compartment OCID.";
258pub const REGIONS_REQUIRED_AWS: &str = "Select at least one AWS region.";
259pub const ZONES_REQUIRED_SCALEWAY: &str = "Select at least one Scaleway zone.";
260pub const SUBSCRIPTIONS_REQUIRED_AZURE: &str = "Enter at least one Azure subscription ID.";
261pub const ALIAS_PREFIX_INVALID: &str =
262 "Alias prefix can't contain spaces or pattern characters (*, ?, [, !).";
263pub const USER_NO_WHITESPACE: &str = "User can't contain whitespace.";
264pub const VAULT_ROLE_FORMAT: &str = "Vault SSH role must be in the form <mount>/sign/<role>.";
265
266pub const VAULT_SIGNING_CANCELLED: &str = "Vault SSH signing cancelled.";
269pub const VAULT_NO_ROLE_CONFIGURED: &str = "No Vault SSH role configured. Set one in the host form \
270 (Vault SSH role field) or on a provider for shared defaults.";
271pub const VAULT_NO_HOSTS_WITH_ROLE: &str = "No hosts with a Vault SSH role configured.";
272pub const VAULT_ALL_CERTS_VALID: &str = "All Vault SSH certificates are still valid.";
273pub const VAULT_NO_ADDRESS: &str = "No Vault address set. Edit the host (e) or provider \
274 and fill in the Vault SSH Address field.";
275
276pub fn vault_error(msg: &str) -> String {
277 format!("Vault SSH: {}", msg)
278}
279
280pub fn vault_signed(alias: &str) -> String {
281 format!("Signed Vault SSH cert for {}", alias)
282}
283
284pub fn vault_sign_failed(alias: &str, message: &str) -> String {
285 format!("Vault SSH: failed to sign {}: {}", alias, message)
286}
287
288pub fn vault_signing_progress(spinner: &str, done: usize, total: usize, alias: &str) -> String {
289 format!(
290 "{} Signing {}/{}: {} (V to cancel)",
291 spinner, done, total, alias
292 )
293}
294
295pub fn vault_cert_saved_host_gone(alias: &str) -> String {
296 format!(
297 "Vault SSH cert saved for {} but host no longer in config \
298 (renamed or deleted). CertificateFile NOT written.",
299 alias
300 )
301}
302
303pub fn vault_spawn_failed(e: &impl std::fmt::Display) -> String {
304 format!("Vault SSH: failed to spawn signing thread: {}", e)
305}
306
307pub fn vault_cert_check_failed(alias: &str, message: &str) -> String {
308 format!("Cert check failed for {}: {}", alias, message)
309}
310
311pub fn vault_role_set(role: &str) -> String {
312 format!("Vault SSH role set to {}.", role)
313}
314
315pub fn snippet_removed(name: &str) -> String {
318 format!("Removed snippet '{}'.", name)
319}
320
321pub fn snippet_added(name: &str) -> String {
322 format!("Added snippet '{}'.", name)
323}
324
325pub fn snippet_updated(name: &str) -> String {
326 format!("Updated snippet '{}'.", name)
327}
328
329pub fn snippet_exists(name: &str) -> String {
330 format!("'{}' already exists.", name)
331}
332
333pub const OUTPUT_COPIED: &str = "Output copied.";
334
335pub fn copy_failed(e: &impl std::fmt::Display) -> String {
336 format!("Copy failed: {}", e)
337}
338
339pub const GLOBAL_DEFAULT_CLEARED: &str = "Global default cleared.";
342pub const PASSWORD_SOURCE_CLEARED: &str = "Password source cleared.";
343
344pub fn global_default_set(label: &str) -> String {
345 format!("Global default set to {}.", label)
346}
347
348pub fn password_source_set(label: &str) -> String {
349 format!("Password source set to {}.", label)
350}
351
352pub fn complete_path(label: &str) -> String {
353 format!("Complete the {} path.", label)
354}
355
356pub fn key_selected(name: &str) -> String {
357 format!("Locked and loaded with {}.", name)
358}
359
360pub fn proxy_jump_set(alias: &str) -> String {
361 format!("Jumping through {}.", alias)
362}
363
364pub fn save_default_failed(e: &impl std::fmt::Display) -> String {
365 format!("Failed to save default: {}", e)
366}
367
368pub fn container_action_complete(action: &str) -> String {
371 format!("Container {} complete.", action)
372}
373
374pub const HOST_KEY_UNKNOWN: &str = "Host key unknown. Connect first (Enter) to trust the host.";
375pub const HOST_KEY_CHANGED: &str =
376 "Host key changed. Possible tampering or server re-install. Clear with ssh-keygen -R.";
377
378pub fn imported_hosts(imported: usize, skipped: usize) -> String {
381 format!(
382 "Imported {} host{}, skipped {} duplicate{}.",
383 imported,
384 if imported == 1 { "" } else { "s" },
385 skipped,
386 if skipped == 1 { "" } else { "s" }
387 )
388}
389
390pub fn all_hosts_exist(skipped: usize) -> String {
391 if skipped == 1 {
392 "Host already exists.".to_string()
393 } else {
394 format!("All {} hosts already exist.", skipped)
395 }
396}
397
398pub fn config_repaired(groups: usize, orphaned: usize) -> String {
401 format!(
402 "Repaired SSH config ({} absorbed, {} orphaned group headers).",
403 groups, orphaned
404 )
405}
406
407pub fn no_exact_match(alias: &str) -> String {
408 format!("No exact match for '{}'. Here's what we found.", alias)
409}
410
411pub fn group_pref_reset_failed(e: &impl std::fmt::Display) -> String {
412 format!("Group preference reset. (save failed: {})", e)
413}
414
415pub fn opened_in_tmux(alias: &str) -> String {
418 format!("Opened {} in new tmux window.", alias)
419}
420
421pub fn tmux_error(e: &impl std::fmt::Display) -> String {
422 format!("tmux: {}", e)
423}
424
425pub fn connection_failed(alias: &str) -> String {
426 format!("Connection to {} failed.", alias)
427}
428
429pub fn host_key_remove_failed(stderr: &str) -> String {
432 format!("Failed to remove host key: {}", stderr)
433}
434
435pub fn ssh_keygen_failed(e: &impl std::fmt::Display) -> String {
436 format!("Failed to run ssh-keygen: {}", e)
437}
438
439pub const TRANSFER_COMPLETE: &str = "Transfer complete.";
442
443pub const PING_EXPIRED: &str = "Ping expired. Press P to refresh.";
446
447pub fn provider_progress(spinner: &str, name: &str, message: &str) -> String {
454 format!("{} {}: {}", spinner, name, message)
455}
456
457pub fn vault_config_reapply_failed(signed: usize, e: &impl std::fmt::Display) -> String {
460 format!(
461 "External edits detected; signed {} certs but failed to re-apply CertificateFile: {}",
462 signed, e
463 )
464}
465
466pub fn vault_external_edits_merged(summary: &str, reapplied: usize) -> String {
467 format!(
468 "{} External ssh config edits detected, merged {} CertificateFile directives.",
469 summary, reapplied
470 )
471}
472
473pub fn vault_external_edits_no_write(summary: &str) -> String {
474 format!(
475 "{} External ssh config edits detected; certs on disk, no CertificateFile written.",
476 summary
477 )
478}
479
480pub fn vault_reparse_failed(signed: usize, e: &impl std::fmt::Display) -> String {
481 format!(
482 "Signed {} certs but cannot re-parse ssh config after external edit: {}. \
483 Certs are on disk under ~/.purple/certs/.",
484 signed, e
485 )
486}
487
488pub fn vault_config_update_failed(signed: usize, e: &impl std::fmt::Display) -> String {
489 format!(
490 "Signed {} certs but failed to update SSH config: {}",
491 signed, e
492 )
493}
494
495pub fn vault_config_write_after_sign(e: &impl std::fmt::Display) -> String {
496 format!("Failed to update config after vault signing: {}", e)
497}
498
499pub fn removed_host_key(hostname: &str) -> String {
504 format!("Removed host key for {}. Reconnecting...", hostname)
505}
506
507pub fn tagged_host(alias: &str, count: usize) -> String {
510 format!(
511 "Tagged {} with {} label{}.",
512 alias,
513 count,
514 if count == 1 { "" } else { "s" }
515 )
516}
517
518pub fn config_reloaded(count: usize) -> String {
521 format!("Config reloaded. {} hosts.", count)
522}
523
524pub fn synced_progress(
540 spinner: &str,
541 active_names: &str,
542 done: usize,
543 total: usize,
544 added: usize,
545 updated: usize,
546 stale: usize,
547) -> String {
548 debug_assert!(
549 !active_names.is_empty(),
550 "synced_progress must only be called while a provider is still in flight"
551 );
552 let diff = sync_diff_suffix(added, updated, stale);
553 format!(
554 "{} Syncing {} \u{00B7} {}/{}{}",
555 spinner, active_names, done, total, diff
556 )
557}
558
559pub fn synced_done(
564 done: usize,
565 total: usize,
566 names: &str,
567 added: usize,
568 updated: usize,
569 stale: usize,
570) -> String {
571 let diff = sync_diff_suffix(added, updated, stale);
572 format!("Synced {}/{} \u{00B7} {}{}", done, total, names, diff)
573}
574
575fn sync_diff_suffix(added: usize, updated: usize, stale: usize) -> String {
576 let parts: Vec<String> = [(added, '+'), (updated, '~'), (stale, '-')]
577 .iter()
578 .filter(|(n, _)| *n > 0)
579 .map(|(n, sign)| format!("{}{}", sign, n))
580 .collect();
581 if parts.is_empty() {
582 String::new()
583 } else {
584 format!(" ({})", parts.join(" "))
585 }
586}
587
588pub const SYNC_THREAD_SPAWN_FAILED: &str = "Failed to start sync thread.";
589
590pub const SYNC_UNKNOWN_PROVIDER: &str = "Unknown provider.";
591
592pub fn vault_signing_cancelled_summary(
595 signed: u32,
596 failed: u32,
597 first_error: Option<&str>,
598) -> String {
599 let mut msg = format!(
600 "Vault SSH signing cancelled ({} signed, {} failed)",
601 signed, failed
602 );
603 if let Some(err) = first_error {
604 msg.push_str(": ");
605 msg.push_str(err);
606 }
607 msg
608}
609
610pub fn regions_selected_count(count: usize, label: &str) -> String {
613 let s = if count == 1 { "" } else { "s" };
614 format!("{} {}{} selected.", count, label, s)
615}
616
617pub const NO_CLIPBOARD_TOOL: &str =
622 "No clipboard tool found. Install pbcopy (macOS), wl-copy (Wayland), or xclip/xsel (X11).";
623
624pub const MCP_TOOL_DENIED_READ_ONLY: &str = "Tool denied. Server started with --read-only. Restart without --read-only to enable state-changing tools.";
627
628pub fn mcp_audit_init_failed(path: &impl std::fmt::Display, e: &impl std::fmt::Display) -> String {
632 format!(
633 "Failed to initialise MCP audit log at {}: {}. Continuing without audit logging.",
634 path, e
635 )
636}
637
638pub fn mcp_audit_write_failed(e: &impl std::fmt::Display) -> String {
640 format!("Failed to write MCP audit entry: {}", e)
641}
642
643pub fn mcp_config_file_not_found(path: &impl std::fmt::Display) -> String {
647 format!("SSH config file not found: {}", path)
648}
649
650pub const MCP_AUDIT_HOME_DIR_UNAVAILABLE: &str = "Could not determine home directory; MCP audit log disabled. Set --audit-log <PATH> explicitly to enable auditing.";
654
655#[path = "messages/cli.rs"]
658pub mod cli;
659
660pub mod update {
663 pub const WHATS_NEW_HINT: &str = "Press n inside purple to see what's new.";
664 pub const DONE: &str = "done.";
665 pub const CHECKSUM_OK: &str = "ok.";
666 pub const SUDO_WARNING: &str =
667 "Running via sudo. Consider fixing directory permissions instead.";
668
669 pub fn already_on(current: &str) -> String {
670 format!("already on v{} (latest).", current)
671 }
672
673 pub fn available(latest: &str, current: &str) -> String {
674 format!("v{} available (current: v{}).", latest, current)
675 }
676
677 pub fn header(bold_name: &str) -> String {
678 format!("\n {} updater\n", bold_name)
679 }
680
681 pub fn binary_path(path: &std::path::Path) -> String {
682 format!(" Binary: {}", path.display())
683 }
684
685 pub fn installed_at(bold_version: &str, path: &std::path::Path) -> String {
686 format!("\n {} installed at {}.", bold_version, path.display())
687 }
688
689 pub fn whats_new_hint_indented() -> String {
690 format!("\n {}", WHATS_NEW_HINT)
691 }
692}
693
694pub mod askpass {
697 pub const BW_NOT_FOUND: &str = "Bitwarden CLI (bw) not found. SSH will prompt for password.";
698 pub const BW_NOT_LOGGED_IN: &str = "Bitwarden vault not logged in. Run 'bw login' first.";
699 pub const EMPTY_PASSWORD: &str = "Empty password. SSH will prompt for password.";
700 pub const PASSWORD_IN_KEYCHAIN: &str = "Password stored in keychain.";
701
702 pub fn read_failed(e: &impl std::fmt::Display) -> String {
703 format!("Failed to read password: {}", e)
704 }
705
706 pub fn unlock_failed_retry(e: &impl std::fmt::Display) -> String {
707 format!("Unlock failed: {}. Try again.", e)
708 }
709
710 pub fn unlock_failed_prompt(e: &impl std::fmt::Display) -> String {
711 format!("Unlock failed: {}. SSH will prompt for password.", e)
712 }
713}
714
715pub mod logging {
718 pub fn init_failed(e: &impl std::fmt::Display) -> String {
719 format!("[purple] Failed to initialize logger: {}", e)
720 }
721
722 pub const SSH_VERSION_FAILED: &str = "[purple] Failed to detect SSH version. Is ssh installed?";
723}
724
725pub mod hints {
731 pub const IDENTITY_FILE_PICK: &str = "Space to pick a key";
736 pub const DEFAULT_SSH_USER: &str = "root";
737
738 pub const HOST_ALIAS: &str = "e.g. prod or db-01";
740 pub const HOST_ALIAS_PATTERN: &str = "10.0.0.* or *.example.com";
741 pub const HOST_HOSTNAME: &str = "192.168.1.1 or example.com";
742 pub const HOST_PORT: &str = "22";
743 pub const HOST_PROXY_JUMP: &str = "Space to pick a host";
744 pub const HOST_VAULT_SSH: &str = "e.g. ssh-client-signer/sign/my-role (auth via vault login)";
745 pub const HOST_VAULT_SSH_PICKER: &str = "Space to pick a role or type one";
746 pub const HOST_VAULT_ADDR: &str =
747 "e.g. http://127.0.0.1:8200 (inherits from provider or env when empty)";
748 pub const HOST_TAGS: &str = "e.g. prod, staging, us-east (comma-separated)";
749 pub const HOST_ASKPASS_PICK: &str = "Space to pick a source";
750
751 pub fn askpass_default(default: &str) -> String {
752 format!("default: {}", default)
753 }
754
755 pub fn inherits_from(value: &str, provider: &str) -> String {
756 format!("inherits {} from {}", value, provider)
757 }
758
759 pub const TUNNEL_BIND_PORT: &str = "8080";
761 pub const TUNNEL_REMOTE_HOST: &str = "localhost";
762 pub const TUNNEL_REMOTE_PORT: &str = "80";
763
764 pub const SNIPPET_NAME: &str = "check-disk";
766 pub const SNIPPET_COMMAND: &str = "df -h";
767 pub const SNIPPET_OPTIONAL: &str = "(optional)";
768
769 pub const PROVIDER_URL: &str = "https://pve.example.com:8006";
771 pub const PROVIDER_TOKEN_DEFAULT: &str = "your-api-token";
772 pub const PROVIDER_TOKEN_PROXMOX: &str = "user@pam!token=secret";
773 pub const PROVIDER_TOKEN_AWS: &str = "AccessKeyId:Secret (or use Profile)";
774 pub const PROVIDER_TOKEN_GCP: &str = "/path/to/service-account.json (or access token)";
775 pub const PROVIDER_TOKEN_AZURE: &str = "/path/to/service-principal.json (or access token)";
776 pub const PROVIDER_TOKEN_TAILSCALE: &str = "API key (leave empty for local CLI)";
777 pub const PROVIDER_TOKEN_ORACLE: &str = "~/.oci/config";
778 pub const PROVIDER_TOKEN_OVH: &str = "app_key:app_secret:consumer_key";
779 pub const PROVIDER_PROFILE: &str = "Name from ~/.aws/credentials (or use Token)";
780 pub const PROVIDER_PROJECT_DEFAULT: &str = "my-gcp-project-id";
781 pub const PROVIDER_PROJECT_OVH: &str = "Public Cloud project ID";
782 pub const PROVIDER_COMPARTMENT: &str = "ocid1.compartment.oc1..aaaa...";
783 pub const PROVIDER_REGIONS_DEFAULT: &str = "Space to select regions";
784 pub const PROVIDER_REGIONS_GCP: &str = "Space to select zones (empty = all)";
785 pub const PROVIDER_REGIONS_SCALEWAY: &str = "Space to select zones";
786 pub const PROVIDER_REGIONS_AZURE: &str = "comma-separated subscription IDs";
788 pub const PROVIDER_REGIONS_OVH: &str = "Space to select endpoint (default: EU)";
789 pub const PROVIDER_USER_AWS: &str = "ec2-user";
790 pub const PROVIDER_USER_GCP: &str = "ubuntu";
791 pub const PROVIDER_USER_AZURE: &str = "azureuser";
792 pub const PROVIDER_USER_ORACLE: &str = "opc";
793 pub const PROVIDER_USER_OVH: &str = "ubuntu";
794 pub const PROVIDER_VAULT_ROLE: &str =
795 "e.g. ssh-client-signer/sign/my-role (vault login; inherited)";
796 pub const PROVIDER_VAULT_ADDR: &str = "e.g. http://127.0.0.1:8200 (inherited by all hosts)";
797 pub const PROVIDER_ALIAS_PREFIX_DEFAULT: &str = "prefix";
798}
799
800#[cfg(test)]
801mod hints_tests {
802 use super::hints;
803
804 #[test]
805 fn askpass_default_formats() {
806 assert_eq!(hints::askpass_default("keychain"), "default: keychain");
807 }
808
809 #[test]
810 fn askpass_default_formats_empty() {
811 assert_eq!(hints::askpass_default(""), "default: ");
812 }
813
814 #[test]
815 fn inherits_from_formats() {
816 assert_eq!(
817 hints::inherits_from("role/x", "aws"),
818 "inherits role/x from aws"
819 );
820 }
821
822 #[test]
823 fn picker_hints_mention_space_not_enter() {
824 for s in [
827 hints::IDENTITY_FILE_PICK,
828 hints::HOST_PROXY_JUMP,
829 hints::HOST_VAULT_SSH_PICKER,
830 hints::HOST_ASKPASS_PICK,
831 hints::PROVIDER_REGIONS_DEFAULT,
832 hints::PROVIDER_REGIONS_GCP,
833 hints::PROVIDER_REGIONS_SCALEWAY,
834 hints::PROVIDER_REGIONS_OVH,
835 ] {
836 assert!(
837 s.starts_with("Space "),
838 "picker hint must mention Space: {s}"
839 );
840 assert!(!s.contains("Enter "), "picker hint must not say Enter: {s}");
841 }
842 }
843}
844
845#[path = "messages/whats_new.rs"]
846pub mod whats_new;
847
848#[path = "messages/whats_new_toast.rs"]
849pub mod whats_new_toast;