feat(credentials): link directories to team secrets (#129)

This commit is contained in:
Anthony Ettinger 2026-08-04 17:17:04 -07:00 committed by GitHub
parent e4723f31b1
commit 12a1d7f479
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 265 additions and 27 deletions

View file

@ -16,15 +16,15 @@ export const CLI_DEFAULT_API = "https://app.logicsrc.com";
* @param {string} origin - the origin this request arrived on
* @returns {string} the card's HTML
*/
// Vaults are addressed as <team> <project> <env> -- three positionals. Anything
// shorter exits with "missing required argument", so a hint that omits one is
// not merely stale, it fails on paste. `--env <path>` is the local .env file
// and already defaults to .env; spelling it out here only invites confusion
// with the <env> positional next to it.
// The short workflow is deliberately directory-linked: up/down must never
// guess a remote target. The explicit push/pull commands remain available,
// but the dashboard teaches the safer link-once flow people use every day.
export const CLI_HINT = (origin) => `<div class="card" style="margin-bottom:22px"><div class="card-head"><span class="h">Connect the CLI</span><span class="pill on">end-to-end encrypted</span></div>
<div class="card-body">
<p class="dim" style="margin-top:0;font-size:.9rem">Secrets are encrypted on your machine decrypt them with the <code>logicsrc</code> CLI, never here.</p>
<pre class="mono" style="background:var(--surface-2);border:1px solid var(--line);border-radius:8px;padding:12px;overflow:auto;font-size:.8rem;margin:0">${origin === CLI_DEFAULT_API ? "" : `LOGICSRC_API=${esc(origin)} `}logicsrc login
logicsrc teams push &lt;team&gt; &lt;project&gt; &lt;env&gt; # share
logicsrc teams pull &lt;team&gt; &lt;project&gt; &lt;env&gt; # receive</pre>
cd /path/to/your/project
logicsrc secrets teams link # select team project env
logicsrc secrets up # share this project's .env
logicsrc secrets down [env] # receive default or named env</pre>
</div></div>`;