Skip to content

Commit 2cc1d57

Browse files
Merge branch 'main' into fix/603-init-next-steps
2 parents 36fec0e + 70b34fa commit 2cc1d57

File tree

27 files changed

+1962
-484
lines changed

27 files changed

+1962
-484
lines changed

CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
### Added
1212

1313
- `apm install` now automatically discovers and deploys local `.apm/` primitives (skills, instructions, agents, prompts, hooks, commands) to target directories, with local content taking priority over dependencies on collision (#626, #644)
14+
- Add `temp-dir` configuration key (`apm config set temp-dir PATH`) to override the system temporary directory, resolving `[WinError 5] Access is denied` in corporate Windows environments (#629)
1415

1516
### Fixed
1617

1718
- `apm init` now creates `start.prompt.md` so `apm run start` works out of the box; Next Steps panel no longer references `apm compile` (#649)
19+
- Fix `apm marketplace add` silently failing for private repos by using credentials when probing `marketplace.json` (#701)
20+
- Pin codex setup to `rust-v0.118.0` for security and reproducibility; update config to `wire_api = "responses"` (#663)
1821
- Propagate headers and environment variables through OpenCode MCP adapter with defensive copies to prevent mutation (#622)
22+
- Fix `apm install` hanging indefinitely when corporate firewalls silently drop SSH packets by setting `GIT_SSH_COMMAND` with `ConnectTimeout=30` (#652)
23+
- Fix `apm compile --target claude` silently skipping dependency instructions stored in `.github/instructions/` (#631)
24+
1925
### Changed
2026

2127
- `apm marketplace browse/search/add/update` now route through the registry proxy when `PROXY_REGISTRY_URL` is set; `PROXY_REGISTRY_ONLY=1` blocks direct GitHub API calls (#506)
@@ -452,7 +458,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
452458

453459
### Fixed
454460

455-
- **Install Script and `apm update`**: Repaired corrupted header in install.sh. Use awk instead of sed for shell subprocess compatibility. Directed shell output to terminal for password input during update process.
461+
- **Install Script and `apm update`**: Repaired corrupted header in install.sh. Use awk instead of sed for shell subprocess compatibility. Directed shell output to terminal for password input during update process.
456462

457463
## [0.7.1] - 2025-01-22
458464

@@ -494,7 +500,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
494500

495501
- **SKILL.md as first-class primitive**: meta-description of what an APM Package does for agents to read
496502
- **Claude Skills Installation**: Install Claude Skills directly as APM Packages
497-
- **Bidirectional Format Support**:
503+
- **Bidirectional Format Support**:
498504
- APM packages → SKILL.md (for Claude target)
499505
- Claude Skills → .agent.md (for VSCode target)
500506
- **Skills Documentation**: New `docs/skills.md` guide
@@ -511,7 +517,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
511517

512518
- **Target Auto-Detection**: Smart compilation based on project structure
513519
- `.github/` only → generates `AGENTS.md` + VSCode integration
514-
- `.claude/` only → generates `CLAUDE.md` + Claude integration
520+
- `.claude/` only → generates `CLAUDE.md` + Claude integration
515521
- Both folders → generates all formats
516522
- Neither folder → generates `AGENTS.md` only (universal format)
517523

docs/src/content/docs/getting-started/authentication.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,9 @@ git config credential.helper # check current helper
281281
git config --global credential.helper osxkeychain # macOS
282282
gh auth login # GitHub CLI
283283
```
284+
285+
### SSH connection hangs on corporate/VPN networks
286+
287+
When no token is available, APM tries SSH before falling back to plain HTTPS. Firewalls that silently drop SSH packets (port 22) can make `apm install` appear to hang. APM sets `GIT_SSH_COMMAND="ssh -o ConnectTimeout=30"` so SSH attempts fail within 30 seconds and the fallback proceeds to HTTPS with git credential helpers.
288+
289+
If you already set `GIT_SSH_COMMAND` (e.g., for a custom key), APM appends `-o ConnectTimeout=30` unless `ConnectTimeout` is already present in your value.

docs/src/content/docs/integrations/runtime-compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ apm runtime setup codex
8383
```
8484

8585
This automatically:
86-
- Downloads the latest Codex binary for your platform
86+
- Downloads Codex binary `rust-v0.118.0` for your platform (override with `--version`)
8787
- Installs to `~/.apm/runtimes/codex`
8888
- Creates configuration for GitHub Models (`github/gpt-4o`)
8989
- Updates your PATH

docs/src/content/docs/reference/cli-commands.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,7 @@ apm config
13451345
- Global configuration
13461346
- APM CLI version
13471347
- `auto-integrate` setting
1348+
- `temp-dir` setting (when configured)
13481349

13491350
**Examples:**
13501351
```bash
@@ -1363,6 +1364,7 @@ apm config get [KEY]
13631364
**Arguments:**
13641365
- `KEY` (optional) - Configuration key to retrieve. Supported keys:
13651366
- `auto-integrate` - Whether to automatically integrate `.prompt.md` files into AGENTS.md
1367+
- `temp-dir` - Custom temporary directory for clone/download operations
13661368

13671369
If `KEY` is omitted, displays all configuration values.
13681370

@@ -1386,6 +1388,7 @@ apm config set KEY VALUE
13861388
**Arguments:**
13871389
- `KEY` - Configuration key to set. Supported keys:
13881390
- `auto-integrate` - Enable/disable automatic integration of `.prompt.md` files
1391+
- `temp-dir` - Set a custom temporary directory path
13891392
- `VALUE` - Value to set. For boolean keys, use: `true`, `false`, `yes`, `no`, `1`, `0`
13901393

13911394
**Configuration Keys:**
@@ -1411,6 +1414,30 @@ apm config set auto-integrate yes
14111414
apm config set auto-integrate 1
14121415
```
14131416

1417+
**`temp-dir`** - Override the system temporary directory
1418+
- **Type:** String (directory path)
1419+
- **Default:** System temp directory (not stored)
1420+
- **Description:** Set a custom temporary directory for clone and download operations. Useful in corporate Windows environments where endpoint security software restricts access to `%TEMP%`, causing `[WinError 5] Access is denied`.
1421+
- **Resolution order:** `APM_TEMP_DIR` environment variable > `temp_dir` in `~/.apm/config.json` > system default.
1422+
- **Use Cases:**
1423+
- Set when the default system temp directory is restricted or unavailable
1424+
- Use the `APM_TEMP_DIR` environment variable for CI pipelines or per-session overrides
1425+
1426+
**Examples:**
1427+
```bash
1428+
# Set a custom temp directory (Windows)
1429+
apm config set temp-dir C:\apm-temp
1430+
1431+
# Set a custom temp directory (macOS/Linux)
1432+
apm config set temp-dir /tmp/apm-work
1433+
1434+
# Check the current temp-dir setting
1435+
apm config get temp-dir
1436+
1437+
# Or use the environment variable instead
1438+
export APM_TEMP_DIR=/tmp/apm-work
1439+
```
1440+
14141441
## Runtime Management (Experimental)
14151442

14161443
### `apm runtime` (Experimental) - Manage AI runtimes

packages/apm-guide/.apm/skills/apm-usage/authentication.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,15 @@ apm install --verbose your-org/package
9696
# Increase git credential timeout (default 30s, max 180s)
9797
export APM_GIT_CREDENTIAL_TIMEOUT=120
9898
```
99+
100+
### SSH connection hangs on corporate/VPN networks
101+
102+
APM tries SSH as a fallback when HTTPS auth is not available. On networks
103+
that silently drop SSH traffic (port 22), this can appear to hang. APM sets
104+
`GIT_SSH_COMMAND="ssh -o ConnectTimeout=30"` so SSH attempts fail within
105+
30 seconds and the fallback chain continues to plain HTTPS with git
106+
credential helpers.
107+
108+
To override the SSH command (e.g., custom key path), set `GIT_SSH_COMMAND`
109+
in your environment. APM appends `-o ConnectTimeout=30` unless it finds
110+
`ConnectTimeout` already present in your value.

packages/apm-guide/.apm/skills/apm-usage/commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@
8181
| Command | Purpose | Key flags |
8282
|---------|---------|-----------|
8383
| `apm config` | Show current configuration | -- |
84-
| `apm config get [KEY]` | Get a config value | -- |
85-
| `apm config set KEY VALUE` | Set a config value | -- |
84+
| `apm config get [KEY]` | Get a config value (`auto-integrate`, `temp-dir`) | -- |
85+
| `apm config set KEY VALUE` | Set a config value (`auto-integrate`, `temp-dir`) | -- |
8686
| `apm update` | Update APM itself | `--check` only check |

scripts/runtime/setup-codex.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Setup script for Codex runtime (Windows)
22
# Downloads Codex binary from GitHub releases and configures with GitHub Models
33

4+
# Pin to a known stable release for security and reproducibility (#662).
5+
# Users can override with: apm runtime setup codex --version <version> (e.g. 'latest')
46
param(
57
[switch]$Vanilla,
6-
[string]$Version = "latest"
8+
[string]$Version = "rust-v0.118.0"
79
)
810

911
$ErrorActionPreference = "Stop"
@@ -161,10 +163,12 @@ model = "openai/gpt-4o"
161163
name = "GitHub Models"
162164
base_url = "https://models.github.ai/inference/"
163165
env_key = "$githubTokenVar"
164-
wire_api = "chat"
166+
wire_api = "responses"
165167
"@ | Set-Content -Path $codexConfig -Encoding UTF8
166168

167169
Write-Success "Codex configuration created at $codexConfig"
170+
Write-Info "Using Codex $Version."
171+
Write-Info "Override with: apm runtime setup codex --version <version> (e.g. 'latest')"
168172
} else {
169173
Write-Info "Vanilla mode: Skipping APM configuration"
170174
}

scripts/runtime/setup-codex.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ source "$SCRIPT_DIR/setup-common.sh"
2323

2424
# Configuration
2525
CODEX_REPO="openai/codex"
26-
CODEX_VERSION="latest" # Default version
26+
# Pin to a known stable release for security and reproducibility (#662).
27+
# Users can override with: apm runtime setup codex --version <version> (e.g. 'latest')
28+
CODEX_VERSION="rust-v0.118.0"
2729
VANILLA_MODE=false
2830

2931
# Parse command line arguments
@@ -204,10 +206,12 @@ model = "openai/gpt-4o"
204206
name = "GitHub Models"
205207
base_url = "https://models.github.ai/inference/"
206208
env_key = "$github_token_var"
207-
wire_api = "chat"
209+
wire_api = "responses"
208210
EOF
209211

210212
log_success "Codex configuration created at $codex_config"
213+
log_info "Using Codex $CODEX_VERSION."
214+
log_info "Override with: apm runtime setup codex --version <version> (e.g. 'latest')"
211215
log_info "APM configured Codex with GitHub Models as default provider"
212216
log_info "Use 'apm install' to configure MCP servers for your projects"
213217
else

src/apm_cli/bundle/unpacker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def unpack_bundle(
5656
# 1. If archive, extract to temp dir
5757
cleanup_temp = False
5858
if bundle_path.is_file() and bundle_path.name.endswith(".tar.gz"):
59-
temp_dir = Path(tempfile.mkdtemp(prefix="apm-unpack-"))
59+
from ..config import get_apm_temp_dir
60+
temp_dir = Path(tempfile.mkdtemp(prefix="apm-unpack-", dir=get_apm_temp_dir()))
6061
cleanup_temp = True
6162
try:
6263
with tarfile.open(bundle_path, "r:gz") as tar:

src/apm_cli/commands/config.py

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ def config(ctx):
8484

8585
config_table.add_row("Global", "APM CLI Version", get_version())
8686

87+
from ..config import get_temp_dir as _get_temp_dir
88+
89+
_temp_dir_val = _get_temp_dir()
90+
if _temp_dir_val:
91+
config_table.add_row("", "Temp Directory", _temp_dir_val)
92+
8793
console.print(config_table)
8894

8995
except (ImportError, NameError):
@@ -105,6 +111,12 @@ def config(ctx):
105111
click.echo(f"\n{HIGHLIGHT}Global:{RESET}")
106112
click.echo(f" APM CLI Version: {get_version()}")
107113

114+
from ..config import get_temp_dir as _get_temp_dir_fb
115+
116+
_temp_dir_fb = _get_temp_dir_fb()
117+
if _temp_dir_fb:
118+
click.echo(f" Temp Directory: {_temp_dir_fb}")
119+
108120

109121
@config.command(help="Set a configuration value")
110122
@click.argument("key")
@@ -116,7 +128,7 @@ def set(key, value):
116128
apm config set auto-integrate false
117129
apm config set auto-integrate true
118130
"""
119-
from ..config import set_auto_integrate
131+
from ..config import set_auto_integrate, set_temp_dir
120132

121133
logger = CommandLogger("config set")
122134
if key == "auto-integrate":
@@ -129,9 +141,17 @@ def set(key, value):
129141
else:
130142
logger.error(f"Invalid value '{value}'. Use 'true' or 'false'.")
131143
sys.exit(1)
144+
elif key == "temp-dir":
145+
try:
146+
set_temp_dir(value)
147+
from ..config import get_temp_dir
148+
logger.success(f"Temporary directory set to: {get_temp_dir()}")
149+
except ValueError as exc:
150+
logger.error(str(exc))
151+
sys.exit(1)
132152
else:
133153
logger.error(f"Unknown configuration key: '{key}'")
134-
logger.progress("Valid keys: auto-integrate")
154+
logger.progress("Valid keys: auto-integrate, temp-dir")
135155
logger.progress(
136156
"This error may indicate a bug in command routing. Please report this issue."
137157
)
@@ -147,27 +167,31 @@ def get(key):
147167
apm config get auto-integrate
148168
apm config get
149169
"""
150-
from ..config import get_config, get_auto_integrate
170+
from ..config import get_auto_integrate, get_temp_dir
151171

152172
logger = CommandLogger("config get")
153173
if key:
154174
if key == "auto-integrate":
155175
value = get_auto_integrate()
156176
click.echo(f"auto-integrate: {value}")
177+
elif key == "temp-dir":
178+
value = get_temp_dir()
179+
if value is None:
180+
click.echo("temp-dir: Not set (using system default)")
181+
else:
182+
click.echo(f"temp-dir: {value}")
157183
else:
158184
logger.error(f"Unknown configuration key: '{key}'")
159-
logger.progress("Valid keys: auto-integrate")
185+
logger.progress("Valid keys: auto-integrate, temp-dir")
160186
logger.progress(
161187
"This error may indicate a bug in command routing. Please report this issue."
162188
)
163189
sys.exit(1)
164190
else:
165-
# Show all config
166-
config_data = get_config()
191+
# Show all user-settable keys with their effective values (including
192+
# defaults). Iterating raw config keys would hide settings that
193+
# have not been written yet (e.g. auto_integrate on a fresh install).
167194
logger.progress("APM Configuration:")
168-
for k, v in config_data.items():
169-
# Map internal keys to user-friendly names
170-
if k == "auto_integrate":
171-
click.echo(f" auto-integrate: {v}")
172-
else:
173-
click.echo(f" {k}: {v}")
195+
click.echo(f" auto-integrate: {get_auto_integrate()}")
196+
temp_dir = get_temp_dir()
197+
click.echo(f" temp-dir: {temp_dir if temp_dir is not None else 'Not set (using system default)'}")

0 commit comments

Comments
 (0)