Skip to content

Comments

proposal: resolve relative CLI paths to absolute before sending to server#233

Open
ZaynJarvis wants to merge 1 commit intovolcengine:mainfrom
ZaynJarvis:fix/cli-rel-to-abs-path
Open

proposal: resolve relative CLI paths to absolute before sending to server#233
ZaynJarvis wants to merge 1 commit intovolcengine:mainfrom
ZaynJarvis:fix/cli-rel-to-abs-path

Conversation

@ZaynJarvis
Copy link
Collaborator

@ZaynJarvis ZaynJarvis commented Feb 20, 2026

Problem

When running ov add-skill ./my-skill or ov add-resource ./my-file from any directory other than the server's working directory, the command fails because relative paths are sent as-is to the server, which resolves them relative to its own CWD.

add-skill error:

Error: API error: SKILL.md must have YAML frontmatter

(Server can't find the path, falls through to treating the string as raw content)

add-resource error:

FileNotFoundError: Path ./my-file does not exist

Root Cause

Both the Python CLI (openviking_cli) and Rust CLI (ov) send the raw path string directly to the server via HTTP. The server resolves it using Python's pathlib.Path() relative to its own working directory, not the caller's CWD.

Fix

Resolve any path that exists on the local filesystem to its absolute path before sending to the server. URLs and raw content strings are passed through unchanged.

Files changed

File Commands fixed
openviking_cli/cli/commands/resources.py add-resource, add-skill
openviking_cli/cli/commands/pack.py export, import
crates/ov_cli/src/main.rs add-resource, add-skill, export, import

Test

# Previously failed from any dir other than server root
cd /some/other/directory
ov add-skill ./path/to/my-skill      # now works
ov add-resource ./path/to/my-file    # now works
ov import ./my-export.ovpack viking://resources/target  # now works
  • tested
  • macos

@ZaynJarvis ZaynJarvis changed the title fix: resolve relative CLI paths to absolute before sending to server WIP: proposal: resolve relative CLI paths to absolute before sending to server Feb 20, 2026
@ZaynJarvis ZaynJarvis marked this pull request as draft February 20, 2026 10:15
@ZaynJarvis ZaynJarvis changed the title WIP: proposal: resolve relative CLI paths to absolute before sending to server proposal: resolve relative CLI paths to absolute before sending to server Feb 22, 2026
Both Python and Rust CLIs were passing relative paths as-is to the
server, which resolved them relative to its own CWD instead of the
caller's. Fix by canonicalizing any path that exists on the local
filesystem before sending. Covers add-resource, add-skill, export,
and import in both CLIs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant