@astra-code/astra-ai 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env.example CHANGED
@@ -2,6 +2,9 @@ ASTRA_BACKEND_URL=https://api.astraaifor.me
2
2
  ASTRA_MODEL=gpt-5.1-codex
3
3
  ASTRA_CLIENT_ID=astra-code
4
4
  ASTRA_RUNTIME_MODE=astra-code
5
+ # Optional: allow loading .env from current project directory.
6
+ # Default is off for safety; user-level env should live in ~/.astra-code/.env
7
+ ASTRA_ALLOW_PROJECT_ENV=0
5
8
  # Optional provider override when model-based detection is not desired.
6
9
  # Examples: openai, claude
7
10
  ASTRA_PROVIDER=
@@ -13,7 +16,9 @@ ASTRA_STT_COMMAND=
13
16
  # Optional: live Whisper transcription tuning
14
17
  ASTRA_STT_MODEL=whisper-1
15
18
  ASTRA_STT_CHUNK_SECONDS=2.5
19
+ ASTRA_VOICE_SILENCE_MS=3000
16
20
  # Optional override for microphone capture.
17
21
  # Use placeholders {output} and {seconds}.
18
- # Example (macOS): sox -q -d -r 16000 -c 1 -b 16 "{output}" trim 0 {seconds}
22
+ # Default on macOS prefers ffmpeg; custom example:
23
+ # ffmpeg -f avfoundation -i ":0" -ar 16000 -ac 1 -t {seconds} "{output}"
19
24
  ASTRA_STT_CAPTURE_COMMAND=
package/README.md CHANGED
@@ -41,12 +41,23 @@ Supported variables:
41
41
  - `ASTRA_MODEL` (default: `gpt-5.1-codex`)
42
42
  - `ASTRA_CLIENT_ID` (default: `astra-code`)
43
43
  - `ASTRA_RUNTIME_MODE` (default: `astra-code`)
44
+ - `ASTRA_ALLOW_PROJECT_ENV` (default: `0`; when `1`, allows reading `.env` from current working directory)
44
45
  - `ASTRA_TTS_COMMAND` (optional; command used for text-to-speech, receives text as final arg)
45
46
  - `ASTRA_STT_COMMAND` (optional; command used for one-shot speech-to-text; must print transcript to stdout)
46
47
  - `ASTRA_STT_MODEL` (default: `whisper-1`, low-cost OpenAI Whisper transcription)
47
48
  - `ASTRA_STT_CHUNK_SECONDS` (default: `2.5`, chunk size for live transcription)
48
49
  - `ASTRA_STT_CAPTURE_COMMAND` (optional; custom mic capture command with `{output}` and `{seconds}` placeholders)
49
- - `OPENAI_API_KEY` or `ASTRA_OPENAI_API_KEY` (required for built-in Whisper live STT)
50
+
51
+ ## Environment loading (security)
52
+
53
+ By default, the CLI loads env vars from:
54
+
55
+ 1. Shell environment (`process.env`)
56
+ 2. `~/.astra-code/.env` (user-level config)
57
+
58
+ Project-level `.env` in the current directory is **disabled by default** and only loaded when `ASTRA_ALLOW_PROJECT_ENV=1`.
59
+
60
+ Built-in STT is backend-only and requires a signed-in session; backend provider keys stay server-side.
50
61
 
51
62
  ## Runtime behavior
52
63
 
@@ -57,7 +68,7 @@ No-args mode launches the Ink terminal UI:
57
68
  - slash commands:
58
69
  - `/help`, `/new`, `/settings`, `/logout`, `/exit`
59
70
  - `/history` (open searchable session history panel)
60
- - `/voice on|off|status|start|stop|input`
71
+ - `/voice`, `/voice on|off|status`, `/voice input` (user voice input; auto-send after silence)
61
72
  - tool-event rendering (`tool_start`, `tool_result`, `credits_update`, `error`)
62
73
  - terminal bridge auto-run for `run_in_terminal` + callback to `/api/agent/terminal-result`
63
74