Skip to content

Commit f0894c7

Browse files
committed
Add npm package README and fix install script issues
- Add README.md for npm package page - Rename TMPDIR to WORK_DIR in install.sh to avoid shadowing POSIX var - Use exact PATH entry match in install.ps1 instead of substring check
1 parent 897b18d commit f0894c7

File tree

3 files changed

+86
-6
lines changed

3 files changed

+86
-6
lines changed

install.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ function Download-And-Install($version) {
5555

5656
# Add to User PATH if not present
5757
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
58-
if ($userPath -notlike "*$installDir*") {
58+
$pathEntries = $userPath -split ";" | Where-Object { $_ -ne "" }
59+
if ($installDir -notin $pathEntries) {
5960
[Environment]::SetEnvironmentVariable("Path", "$userPath;$installDir", "User")
6061
$env:Path = "$env:Path;$installDir"
6162
Write-Host "Added $installDir to User PATH" -ForegroundColor Green

install.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ download_and_install() {
5656
ARCHIVE="${BINARY}-${TARGET}.tar.gz"
5757
URL="https://github.com/${REPO}/releases/download/${VERSION}/${ARCHIVE}"
5858

59-
TMPDIR="$(mktemp -d)"
60-
trap 'rm -rf "$TMPDIR"' EXIT
59+
WORK_DIR="$(mktemp -d)"
60+
trap 'rm -rf "$WORK_DIR"' EXIT
6161

6262
info "Downloading $URL..."
63-
curl -fsSL "$URL" -o "${TMPDIR}/${ARCHIVE}"
63+
curl -fsSL "$URL" -o "${WORK_DIR}/${ARCHIVE}"
6464

6565
info "Extracting..."
66-
tar xzf "${TMPDIR}/${ARCHIVE}" -C "$TMPDIR"
66+
tar xzf "${WORK_DIR}/${ARCHIVE}" -C "$WORK_DIR"
6767

6868
# Determine install directory
6969
if [ -w "/usr/local/bin" ]; then
@@ -73,7 +73,7 @@ download_and_install() {
7373
mkdir -p "$INSTALL_DIR"
7474
fi
7575

76-
install -m 755 "${TMPDIR}/${BINARY}" "${INSTALL_DIR}/${BINARY}"
76+
install -m 755 "${WORK_DIR}/${BINARY}" "${INSTALL_DIR}/${BINARY}"
7777
info "Installed to ${INSTALL_DIR}/${BINARY}"
7878

7979
# Check if install dir is in PATH

npm/authy-cli/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# authy-cli
2+
3+
A CLI secrets store & dispatch tool built for AI agents.
4+
5+
Authy stores encrypted secrets locally and dispatches them to agents with policy-based scoping, short-lived session tokens, and audit logging. No server required.
6+
7+
## Install
8+
9+
```bash
10+
npx authy-cli --help
11+
```
12+
13+
Or install globally:
14+
15+
```bash
16+
npm install -g authy-cli
17+
authy --help
18+
```
19+
20+
### Other install methods
21+
22+
```bash
23+
# Linux/macOS
24+
curl -fsSL https://raw.githubusercontent.com/eric8810/authy/main/install.sh | sh
25+
26+
# Windows (PowerShell)
27+
irm https://raw.githubusercontent.com/eric8810/authy/main/install.ps1 | iex
28+
```
29+
30+
## Quick Start
31+
32+
```bash
33+
# Initialize a vault with a keyfile
34+
authy init --generate-keyfile ~/.authy/keys/master.key
35+
36+
# Store a secret (reads from stdin)
37+
authy store db-url
38+
39+
# Retrieve it
40+
authy get db-url
41+
42+
# Launch the admin TUI (secrets never touch shell history)
43+
authy admin --keyfile ~/.authy/keys/master.key
44+
```
45+
46+
## Agent Workflow
47+
48+
```bash
49+
# Create a scoped policy
50+
authy policy create deploy-agent --allow "db-*" --deny "openai-*"
51+
52+
# Create a short-lived session token
53+
authy session create --scope deploy-agent --ttl 1h
54+
55+
# Agent uses the token to read only allowed secrets
56+
export AUTHY_TOKEN="authy_v1...."
57+
export AUTHY_KEYFILE=~/.authy/keys/master.key
58+
authy get db-url # works
59+
authy get openai-api-key # denied
60+
61+
# Or inject secrets into a subprocess
62+
authy run --scope deploy-agent -- ./deploy.sh
63+
```
64+
65+
## Supported Platforms
66+
67+
| Platform | Architecture |
68+
|----------|-------------|
69+
| Linux | x64, arm64 |
70+
| macOS | x64, arm64 |
71+
| Windows | x64 |
72+
73+
## Documentation
74+
75+
For full documentation, see the [GitHub repository](https://github.com/eric8810/authy).
76+
77+
## License
78+
79+
MIT

0 commit comments

Comments
 (0)