Skip to content

Snapshots (Multi-Version Management) ​

Snapshots save immutable versions of a selected file tree. Use commit to save a version, log to browse history, show to read an older file, diff to compare file contents, diff-paths to list changed files, and restore to recover saved content. Uncommitted or excluded files are outside the recovery scope; ACLs and vector indexes are not versioned.

Snapshots are powered by gitoxide embedded in the Rust RAGFS layer, maintaining one logical Git repository per account_id. Use the snapshot APIs to manage versions; direct edits to the underlying repository are not part of this workflow.

The core commands:

CommandPurpose
commitSave the current workspace state as a new snapshot
logWalk commit history starting from the newest
showView a commit's metadata, or read a file's content from that commit
diffCompare one file between two snapshots as a unified diff
diff-pathsPage changed source files under selected directories
restoreRestore a directory (or the whole account tree) to a past snapshot

In addition, account-level .ovgitignore exclusion rules can be managed (get/set/delete) to exclude matching files from commit. See Ignore management.

Core Concepts ​

  • Commit: A snapshot is a commit, uniquely identified by a 40-hex SHA-1 commit_oid. Most commands also accept an abbreviated OID prefix or a branch name (e.g. main).
  • Branch: The default branch is main. Unless you pass one explicitly, every command operates on main.
  • Forward-commit restore: restore does not rewind or rewrite history. It reads the content at source_commit, writes the diff back into the workspace, and creates a new commit on top of the current HEAD. The new commit's parent is therefore the HEAD that existed before the restore — not source_commit. The restore preserves prior commits; when the selected source tree matches HEAD, it returns noop without creating a commit. This comparison does not inspect uncommitted workspace changes.
  • Scope: commit can be limited to specific URIs via paths; restore can be limited to a subtree via project_dir, leaving files outside it untouched.

ACL permissions ​

Snapshots use the current ACL at operation time. ACLs are not stored in snapshots, read from historical versions, or rolled back. Public resources without ACLs keep their legacy visibility; once ACL is enabled, these permissions apply:

OperationRequired permission
show(path=...) / diff / logread
diff_pathsread on requested directories and every changed file; any denied descendant rejects the whole query without exposing its URI
commitread; directories recursively check every current descendant and fail as a whole if any node is denied
restore overwriting a filewrite on the file
restore creating a filewrite on the parent directory
restore deleting a filewrite on the file
Read/write/delete .ovgitignoreADMIN or ROOT

USER and ADMIN callers must provide paths for commit and log, project_dir for restore, and path for show; account-wide commit metadata lookup without path is reserved for local ROOT mode. A user can operate on accessible shared resources and their own viking://user/{user_id}/... space, but not another user's space. Directory operations preflight the complete scope instead of silently skipping denied descendants. restore authorizes every planned write and deletion before it mutates the workspace.

Existing nodes keep their current ACL after restore. Newly restored nodes inherit the current parent ACL; the user who runs restore is not granted manage. The background vector rebuild is system work for an already-authorized operation, so parent ACLs do not block it again.

Implementation ​

API Reference ​

commit() ​

Save the current workspace state as a new snapshot.

Partial commits preserve the previous snapshot outside the requested scope. After deleting a file or directory, include that URI or its parent in paths to record the deletion. A trailing / does not declare its type. Non-ROOT commits use Exact for existing files and Tree for existing directories; missing targets are unlocked with the filesystem lock provider and use Tree with the cache provider. Concurrent recreation of a missing target is not guaranteed to be fully captured; see commit scope and concurrency.

Parameters

ParameterTypeRequiredDefaultDescription
messagestrYes-Commit message
pathsList[str]Nonullviking:// URIs to scope the snapshot to; entries may be files or directories. Directories are expanded recursively with the snapshot pruning rules applied. USER/ADMIN callers must provide this field; null account-wide snapshots are reserved for local ROOT mode. An empty list [] selects no files. A path that exists in neither the VFS nor the previous snapshot logs a warning and is treated as a no-op deletion
branchstrNomainBranch to advance
author_namestrNonullOverride the default author name (default viking-bot)
author_emailstrNonullOverride the default author email

Python SDK (HTTP)

python
result = client.snapshot.commit(
    message="v1 initial import",
    paths=["viking://resources/my_md.md"],
)
print(result["commit_oid"])

TypeScript SDK

typescript
console.log(await client.gitCommit({ message: "Update docs", paths: ["resources/docs"] }));

HTTP API

POST /api/v1/snapshot/commit
bash
curl -X POST "http://localhost:1933/api/v1/snapshot/commit" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-key" \
  -d '{
    "message": "v1 initial import",
    "paths": ["viking://resources/my_md.md"]
  }'

CLI

bash
ov snapshot commit -m "v1 initial import" --paths viking://resources/my_md.md -o json

Response

When a new snapshot is created:

json
{
  "status": "ok",
  "result": {
    "result": "created",
    "commit_oid": "3f2a1b9c4d5e6f70819293a4b5c6d7e8f9a0b1c2",
    "changed": 3,
    "ignored": 1
  }
}

changed is the number of paths added/updated/removed in this commit; ignored is the number of candidate paths skipped by the account .ovgitignore rules (built-in system pruning is not counted). The first commit on a branch creates a valid snapshot even when no files are selected or all selected files are excluded; it returns created with changed=0. Empty directories themselves are not recorded. When the workspace is unchanged relative to the last commit, the result is noop and commit_oid is the current HEAD (noop also returns ignored but has no changed):

json
{
  "status": "ok",
  "result": {
    "result": "noop",
    "commit_oid": "3f2a1b9c4d5e6f70819293a4b5c6d7e8f9a0b1c2",
    "ignored": 0
  }
}

log() ​

Starting from a branch's HEAD, walk history along the first parent (parents[0]) and return commits newest-first.

Parameters

ParameterTypeRequiredDefaultDescription
branchstrNomainBranch or commit ID to start from
limitintNo20Max commits to return. The HTTP endpoint accepts values from 1 to 500
offsetintNo0Number of matching commits to skip; must be a non-negative integer. For pages of 10, use offset=10 for the second page
pathsList[str]NonullReturn only commits that changed any specified viking:// URI; USER/ADMIN callers must provide it, while local ROOT mode may omit it for account-wide history. At most 32 paths are accepted, and each account-relative path may contain at most 64 components. Pass multiple URIs to HTTP as repeated paths query parameters

For each supplied paths URI, the server compares the tree entry at that exact path with the entry at the same path in parents[0]. Merge commits use only the first parent. A commit without parents is compared with an empty tree.

Path filtering and commit de-duplication happen before offset and limit are applied. With paths=[X], offset=10, and limit=10, the result contains matches 11–20 for X. Unrelated commits do not advance the offset; a commit touching multiple requested paths counts once. Once traversal reaches the end of history, an offset beyond the matching commits returns an empty list.

When paths is provided, the server can use the optional path history index configured by git.snapshot.log in ov.conf. The index is derived from snapshot commits and does not change the response format:

  • With a current index, the server queries matching commits directly.
  • With an index behind HEAD, the server scans the newer commits and combines their matches with indexed history. This tail scan has no 1,000-commit cap.
  • When no usable index is available, the legacy filtered scan still inspects at most 1,000 candidate commits, including unrelated commits and matches skipped by offset. If the requested page is incomplete and older uninspected history remains, it returns INVALID_ARGUMENT without partial results.

Without paths, queries are not subject to the 1,000-commit scan limit above.

For pages of 10, omit offset for the first page and use offset=10 for the next page, as shown below. Each request starts from the current branch HEAD; new commits between requests can shift page boundaries.

Python SDK (HTTP)

python
history = client.snapshot.log(
    limit=10,
    offset=10,
    paths=["viking://resources/a.md", "viking://resources/docs"],
)
for commit in history:
    print(commit["oid"], commit["message"])

TypeScript SDK

typescript
console.log(
  await client.gitLog("main", 10, [
    "viking://resources/a.md",
    "viking://resources/docs",
  ], 10),
);

HTTP API

GET /api/v1/snapshot/log?branch={branch}&limit={limit}&offset={offset}&paths={uri1}&paths={uri2}
bash
curl --get "http://localhost:1933/api/v1/snapshot/log" \
  --data-urlencode "branch=main" \
  --data-urlencode "limit=10" \
  --data-urlencode "offset=10" \
  --data-urlencode "paths=viking://resources/a.md" \
  --data-urlencode "paths=viking://resources/docs" \
  -H "X-API-Key: your-key"

CLI

bash
ov snapshot log --limit 10 --offset 10 \
  --paths viking://resources/a.md,viking://resources/docs \
  -o json

Response

result is a list of commit metadata, each element having the same shape as the metadata returned by show():

json
{
  "status": "ok",
  "result": [
    {
      "oid": "9a0b1c2d3e4f5061728394a5b6c7d8e9f0a1b2c3",
      "tree": "11223344556677889900aabbccddeeff00112233",
      "parents": ["3f2a1b9c4d5e6f70819293a4b5c6d7e8f9a0b1c2"],
      "author": {
        "name": "viking-bot",
        "email": "bot@openviking.local",
        "time_seconds": 1750300000,
        "tz_offset_seconds": 28800
      },
      "committer": {
        "name": "viking-bot",
        "email": "bot@openviking.local",
        "time_seconds": 1750300000,
        "tz_offset_seconds": 28800
      },
      "message": "v2 modify delete add"
    }
  ]
}

When the branch has no commits yet, the HTTP endpoint returns 404 NOT_FOUND.


show() ​

View a commit's metadata; if path is given, return that file's content from the commit instead.

Parameters

ParameterTypeRequiredDefaultDescription
target_refstrYes-Commit OID (abbreviated prefix allowed), branch name, or tag
pathstrNonullviking:// URI of a single file; omitting it returns commit metadata only in local ROOT mode

Python SDK (HTTP)

python
# View commit metadata (local ROOT mode only)
meta = client.snapshot.show("3f2a1b9c")
print(meta["message"], meta["parents"])

# Read a file's content from the commit
blob = client.snapshot.show("3f2a1b9c", path="viking://resources/my_project/guide.md")

TypeScript SDK

typescript
console.log(await client.gitShow("main", "viking://resources/docs/api.md"));

Note: when reading a file (path given), the Python client returns a {"oid": str, "size": int, "bytes": bytes} dict.

HTTP API

GET /api/v1/snapshot/show?target_ref={ref}[&path={uri}]
bash
# Commit metadata (returns JSON; local ROOT mode only)
curl -X GET "http://localhost:1933/api/v1/snapshot/show?target_ref=3f2a1b9c" \
  -H "X-API-Key: your-key"

# File content (returns a binary stream)
curl -X GET "http://localhost:1933/api/v1/snapshot/show?target_ref=3f2a1b9c&path=viking://resources/my_project/guide.md" \
  -H "X-API-Key: your-key"

Without path, the response is commit metadata JSON. With path, the response is a raw byte stream (Content-Type: application/octet-stream) with these headers:

  • X-Snapshot-Oid: the blob object's OID
  • X-Snapshot-Size: the returned body size in bytes
  • X-Snapshot-Commit-Oid: the full commit OID resolved from target_ref, distinct from the blob OID
  • X-Snapshot-Time-Seconds: the resolved commit's committer.time_seconds, an integer Unix timestamp in seconds

The timestamp describes the requested snapshot, not the file's last modification or the run's completion time. Branches and tags are resolved once so the body and commit headers refer to the same snapshot. The commit headers also apply to raw=false; stripping memory fields only changes the body and its size.

When the commit tree has no entry for the requested file path, the server returns HTTP 404 with error.code: "NOT_FOUND", error.details.type: "git_blob", and error.details.reason: "path_not_found". The boolean error.details.deleted_file is true when the first parent (parents[0]) has a file at that exact path. It is false if the first parent has a directory or no entry there, or the commit has no parent. A missing backing object for the requested file has no path_not_found reason. Gateways can preserve these distinctions by forwarding the error details.

CLI

bash
# Commit metadata (local ROOT mode only)
ov snapshot show 3f2a1b9c -o json

# Read file content (defaults to stdout; use --out-file to write to a local file)
ov snapshot show 3f2a1b9c --path viking://resources/my_project/guide.md --out-file ./guide.md

Response (commit metadata)

json
{
  "status": "ok",
  "result": {
    "oid": "3f2a1b9c4d5e6f70819293a4b5c6d7e8f9a0b1c2",
    "tree": "00112233445566778899aabbccddeeff00112233",
    "parents": [],
    "author": {
      "name": "viking-bot",
      "email": "bot@openviking.local",
      "time_seconds": 1750299000,
      "tz_offset_seconds": 28800
    },
    "committer": {
      "name": "viking-bot",
      "email": "bot@openviking.local",
      "time_seconds": 1750299000,
      "tz_offset_seconds": 28800
    },
    "message": "v1 initial import"
  }
}

diff() ​

Compare one UTF-8 file between two snapshot refs and return a unified diff. to_ref is required. When from_ref is omitted, the older side is treated as an empty file, which is useful for displaying the initial version.

Python SDK (HTTP)

python
result = client.snapshot.diff(
    "viking://resources/my_project/guide.md",
    from_ref="3f2a1b9c",
    to_ref="9a0b1c2d",
)
print(result["diff_text"])

TypeScript SDK

typescript
const result = await client.gitDiff(
  "viking://resources/my_project/guide.md",
  "9a0b1c2d",
  "3f2a1b9c",
);
console.log(result.diff_text);

HTTP API

GET /api/v1/snapshot/diff?path={uri}&from={old_ref}&to={new_ref}
bash
curl --get "http://localhost:1933/api/v1/snapshot/diff" \
  --data-urlencode "path=viking://resources/my_project/guide.md" \
  --data-urlencode "from=3f2a1b9c" \
  --data-urlencode "to=9a0b1c2d" \
  -H "X-API-Key: your-key"

CLI

bash
ov snapshot diff viking://resources/my_project/guide.md \
  --from 3f2a1b9c \
  --to 9a0b1c2d

Response

json
{
  "status": "ok",
  "result": {
    "path": "viking://resources/my_project/guide.md",
    "from_commit": "3f2a1b9c...",
    "to_commit": "9a0b1c2d...",
    "change_type": "modified",
    "diff_text": "--- a/guide.md\n+++ b/guide.md\n@@ -1 +1 @@\n-old line\n+new line\n"
  }
}

change_type is added, deleted, modified, or unchanged. Each side is limited to 10 MiB and 100,000 lines, and the generated diff is limited to 20 MiB; larger requests return RESOURCE_EXHAUSTED rather than a truncated diff.


diff_paths() ​

List source files added, modified, or deleted under one or more directories between snapshots. Derived summaries (.abstract.md, .overview.md, .relations.json) are excluded. Overlapping directory scopes produce one entry per file, ordered by URI.

HTTP parameterRequiredDefaultDescription
pathsYes-Directory URIs; repeat the query parameter for each directory
fromNonullBase snapshot ref; omit it (SDK from_ref=None) to compare against an empty tree and list target files as added
toYes-Valid target snapshot ref; cannot be empty or null
offsetNo0Non-negative starting position
limitNo100Page size, from 1 to 1000

HTTP API

http
GET /api/v1/snapshot/diff-paths?paths={uri1}&paths={uri2}&from={base}&to={head}&offset=0&limit=100

CLI

bash
ov snapshot diff-paths \
  --paths viking://resources/research,viking://resources/notes \
  --from 3f2a1b9c --to 9a0b1c2d --offset 0 --limit 100 -o json

Python SDK (HTTP)

python
page = client.snapshot.diff_paths(
    ["viking://resources/research", "viking://resources/notes"],
    from_ref="3f2a1b9c", to_ref="9a0b1c2d", offset=0, limit=100,
)

Response

json
{
  "status": "ok",
  "result": {
    "changes": [{"uri": "viking://resources/research/guide.md", "change_type": "modified"}],
    "offset": 0,
    "limit": 100,
    "total": 1,
    "has_more": false,
    "next_offset": null
  }
}

change_type is added, modified, or deleted. While has_more is true, query next_offset with the same paths and snapshot IDs; only the final page has next_offset=null. Pagination limits the response size; the underlying comparison still computes the complete change list. Use diff() or show() to read file contents.


restore() ​

Restore a directory (or the whole account tree) to its state at source_commit.

This is a forward-commit restore: it computes the diff between source_commit and the current HEAD, writes it back into the workspace, and creates a new commit on top of the current HEAD. The new commit's parent is the pre-restore HEAD (not source_commit), so history is never rewritten. Files outside project_dir are left untouched.

Parameters

ParameterTypeRequiredDefaultDescription
source_commitstrYes-What to restore from: commit OID (abbreviated prefix allowed), branch name, or tag
project_dirstrNonullviking:// URI of the subtree to restore. USER/ADMIN callers must provide it; omitting it for a whole-account restore is reserved for local ROOT mode
branchstrNomainBranch to advance
dry_runboolNofalseCompute and return the diff only; write nothing
messagestrNonullMessage for the new commit; auto-generated when omitted
author_namestrNonullOverride the default author name
author_emailstrNonullOverride the default author email

Python SDK (HTTP)

python
# Preview which files would change first
plan = client.snapshot.restore(
    project_dir="viking://resources/my_project",
    source_commit="3f2a1b9c",
    dry_run=True,
)
print(plan["diff"])
python
# Apply after reviewing the plan
result = client.snapshot.restore(
    project_dir="viking://resources/my_project",
    source_commit="3f2a1b9c",
    message="restore to v1",
)
print(result["result"])
if result["result"] == "applied":
    print(result["new_commit_oid"])

TypeScript SDK

typescript
console.log(await client.gitRestore({
  projectDir: "viking://resources/docs",
  sourceCommit: "3f2a1b9c",
}));

HTTP API

POST /api/v1/snapshot/restore
bash
curl -X POST "http://localhost:1933/api/v1/snapshot/restore" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-key" \
  -d '{
    "project_dir": "viking://resources/my_project",
    "source_commit": "3f2a1b9c",
    "message": "restore to v1"
  }'

CLI

bash
# Positional args are <source_commit> then <project_dir>
# Preview first
ov snapshot restore 3f2a1b9c viking://resources/my_project --dry-run -o json

# Apply after reviewing the plan
ov snapshot restore 3f2a1b9c viking://resources/my_project -m "restore to v1" -o json

Response (applied)

On a successful write that produces a new commit, result is applied. Note parent_commit equals the old (pre-restore) HEAD, confirming the forward-commit semantics:

json
{
  "status": "ok",
  "result": {
    "result": "applied",
    "new_commit_oid": "c3d4e5f60718293a4b5c6d7e8f9a0b1c2d3e4f50",
    "source_commit": "3f2a1b9c4d5e6f70819293a4b5c6d7e8f9a0b1c2",
    "parent_commit": "9a0b1c2d3e4f5061728394a5b6c7d8e9f0a1b2c3",
    "written": 1,
    "deleted": 1,
    "unchanged": 1,
    "written_paths": ["resources/my_project/guide.md"],
    "deleted_paths": ["resources/my_project/changelog.md"],
    "task_id": "snapshot_restore_reindex-..."
  }
}

When the restore has vector side effects (files written/deleted), the response carries a task_id you can poll via GET /api/v1/tasks/{task_id} to track the background vector rebuild.

Response (noop)

When the source is byte-identical to the current state, the result is noop and no new commit is created:

json
{
  "status": "ok",
  "result": {
    "result": "noop",
    "head": "9a0b1c2d3e4f5061728394a5b6c7d8e9f0a1b2c3",
    "source": "3f2a1b9c4d5e6f70819293a4b5c6d7e8f9a0b1c2"
  }
}

Response (dry_run)

With dry_run=true, only the planned diff is returned and nothing is written. Diff paths are relative to project_dir:

json
{
  "status": "ok",
  "result": {
    "result": "dry_run",
    "head": "9a0b1c2d3e4f5061728394a5b6c7d8e9f0a1b2c3",
    "source": "3f2a1b9c4d5e6f70819293a4b5c6d7e8f9a0b1c2",
    "diff": {
      "to_write": [{"path": "guide.md", "oid": "..."}],
      "to_delete": ["changelog.md"],
      "unchanged": ["notes/todo.md"]
    }
  }
}

Single-file version restore ​

POST /api/v1/snapshot/restore restores historical content at any permitted file path. No Compile configuration or output ownership is required. This mode accepts the following fields and cannot be combined with project_dir or source_commit:

ParameterTypeDescription
pathstrFile URI, also used as the historical snapshot path
restore_commit_idstrSource commit ID, 40 lowercase hexadecimal characters
current_commit_idstrOptional. Omit to restore unconditionally, or pass the last commit observed for this file on main. A mismatch returns 409 CONFLICT with resource VERSION_CONFLICT
dry_runboolOptional; checks the request without changing content or creating a snapshot
bash
ov snapshot restore <restore_commit_id> --file viking://resources/wiki/entity/project.md
ov snapshot restore <restore_commit_id> --file viking://resources/wiki/entity/project.md --current-commit-id <current_commit_id>

GET /api/v1/snapshot/versions?uri=<file URI>&limit=20 returns native Git history, newest first:

json
{
  "status": "ok",
  "result": {
    "uri": "viking://resources/wiki/entity/project.md",
    "versions": [{"oid": "54c71fb7bf134b71a9b7ed604c21f5b412345678", "message": "content write"}],
    "next_before_snapshot": null
  }
}

Each history entry is native commit metadata, including its oid; no separate version index, UUID or version number is maintained. limit is 1–100, default 20. Pass next_before_snapshot as before_snapshot to continue after that commit; null marks the end. History does not depend on a Compile run or configuration.

bash
curl -X POST "http://localhost:1933/api/v1/snapshot/restore" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-key" \
  -d '{
    "path": "viking://resources/wiki/entity/project.md",
    "restore_commit_id": "0334d9abe4ac4f25a3e59d0b401bb01c12345678",
    "current_commit_id": "54c71fb7bf134b71a9b7ed604c21f5b412345678"
  }'

The response contains uri, snapshot_id, and result (created, noop, or dry_run). Changed content produces a forward snapshot and normal index maintenance. Identical content may return the existing snapshot as noop. Dry runs do not write content or create a snapshot. The dry-run snapshot_id is null when current_commit_id is omitted.

When current_commit_id is supplied, the last file commit is checked before reading historical content and again under the content write lock. Uncommitted edits also return 409; omit current_commit_id to restore unconditionally. Stale requests return 409; missing history or paths return 404. ACL checks and index maintenance still apply. Restore uses the same path and does not follow renames. Neither file nor directory restore writes Compile state or run history; directory restore already produces its own forward commit.


Ignore management ​

The .ovgitignore file at the account root is an account-level exclusion file. At commit time, files matching the rules are excluded from the snapshot; the rules file itself is never ignored by .ovgitignore rules (a rule matching .ovgitignore does not exclude it) and never enters vector indexing. Rules affect only commit, not restore/show/log.

The syntax is a common glob subset: blank lines are ignored, #-prefixed lines are comments, leading/trailing whitespace is trimmed; ! negation and backslash escaping are unsupported; the file is capped at 64 KiB (validated on write). Matching uses account-relative Git tree paths (/-separated).

Three methods are provided: get_gitignore (read, empty string when absent), set_gitignore (write), and delete_gitignore (delete, missing is success and idempotent). All three require ADMIN or ROOT permission, use the account from the request context, and take no path argument.

get_gitignore() ​

Reads the account .ovgitignore content; returns an empty string when the file is absent.

Python SDK (HTTP)

python
content = client.snapshot.get_gitignore()

TypeScript SDK

typescript
console.log(await client.gitGetIgnore());

HTTP API

GET /api/v1/snapshot/ignore
bash
curl -X GET "http://localhost:1933/api/v1/snapshot/ignore" \
  -H "X-API-Key: your-key"

CLI

bash
ov snapshot ignore-get -o json

Response

json
{
  "status": "ok",
  "result": "*.log\n"
}

Without -o json, the CLI prints the raw content to stdout (so it can be redirected to a file).

set_gitignore() ​

Writes the account .ovgitignore content (overwrites). The size limit (64 KiB) is validated up front; syntax (negation, escaping) is validated at commit time by the Rust layer.

Parameters

ParameterTypeRequiredDefaultDescription
contentstrYes-The .ovgitignore content (UTF-8)

Python SDK (HTTP)

python
client.snapshot.set_gitignore(content="*.log\n")

TypeScript SDK

typescript
await client.gitSetIgnore("*.tmp\n.cache/\n");

HTTP API

PUT /api/v1/snapshot/ignore
bash
curl -X PUT "http://localhost:1933/api/v1/snapshot/ignore" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-key" \
  -d '{"content": "*.log\n"}'

CLI

bash
# Pass content inline with --content, or read from a file with --file
ov snapshot ignore-set --content "*.log" -o json
ov snapshot ignore-set --file ./my-rules -o json

Response

json
{
  "status": "ok",
  "result": null
}

delete_gitignore() ​

Deletes the account .ovgitignore. Missing is success (idempotent).

Python SDK (HTTP)

python
client.snapshot.delete_gitignore()

TypeScript SDK

typescript
await client.gitDeleteIgnore();

HTTP API

DELETE /api/v1/snapshot/ignore
bash
curl -X DELETE "http://localhost:1933/api/v1/snapshot/ignore" \
  -H "X-API-Key: your-key"

CLI

bash
ov snapshot ignore-delete -o json

Response

json
{
  "status": "ok",
  "result": null
}

A Typical Flow ​

A complete "commit → modify → restore" flow (Python SDK):

python
from openviking_sdk import SyncHTTPClient

client = SyncHTTPClient(url="http://localhost:1933", api_key="your-key")
client.initialize()

root = "viking://resources/my_project"

# 1. Write initial content and commit v1
client.write(
    uri=f"{root}/guide.md",
    content="# Guide\n\nv1 content\n",
    mode="create",
)
v1 = client.snapshot.commit(message="v1 initial import", paths=[root])

# 2. Modify and commit v2
client.write(
    uri=f"{root}/guide.md",
    content="# Guide\n\nv2 content\n",
    mode="replace",
)
v2 = client.snapshot.commit(message="v2 update", paths=[root])

# 3. Walk history
for c in client.snapshot.log(limit=10, paths=[root]):
    print(c["oid"][:8], c["message"])

# 4. Restore the workspace to v1 (creates a new commit on top of v2)
client.snapshot.restore(project_dir=root, source_commit=v1["commit_oid"], message="restore to v1")

client.close()

For more end-to-end examples, see the examples/snapshot/ directory in the repository, covering the SDK, HTTP, and CLI surfaces.

Error Handling ​

ScenarioHTTP StatusError Code
Branch/commit not found, or show's path does not exist in that commit404NOT_FOUND
A required operation scope is omitted, or the caller lacks the corresponding ACL permission403PERMISSION_DENIED
Branch concurrently advanced during restore (CAS conflict)409CONFLICT
.ovgitignore too large, non-UTF-8, or containing unsupported ! negation/backslash escaping (validated at commit time)400INVALID_ARGUMENT
Request body contains an unknown field (request model is extra="forbid")400INVALID_ARGUMENT
  • File System: snapshots build on filesystem resources
  • Background Tasks: track the background vector rebuild triggered by restore via GET /api/v1/tasks/{task_id}
  • API Overview: full endpoint reference

Open source under the AGPL-3.0 License. Font licenses