Skip to content

Latest commit

 

History

History
172 lines (118 loc) · 3.24 KB

File metadata and controls

172 lines (118 loc) · 3.24 KB

Quick Start

This guide gets a new client from installation to reading and searching Drive files.

1. Install

Latest release:

curl -fsSL https://raw.githubusercontent.com/diskd-ai/diskd-cli/main/install.sh | sh

Pinned release:

curl -fsSL https://raw.githubusercontent.com/diskd-ai/diskd-cli/main/install.sh | DISKD_VERSION=v0.1.5 sh

Confirm the binary:

diskd version

Use JSON output by placing --json before the subcommand:

diskd --json version

Update later:

diskd update

2. Configure API Access

Browser login:

diskd login

This opens https://app.iosya.com/oauth-apps. Use diskd login --dev for https://app.upgraide.dev/oauth-apps.

For an already-issued bearer token:

export APIS_BASE_URL="https://apis.iosya.com"
diskd login --token "$APIS_ACCESS_TOKEN"

For a CI or service-client credential file:

diskd login --credentials-file ./credentials.json

The credential file format is:

{
  "issuer": "https://auth.example",
  "clientId": "client-id",
  "clientSecret": "client-secret",
  "audience": "diskd-api",
  "apisUrl": "https://apis.iosya.com"
}

diskd stores only the returned bearer token in $DISKD_HOME/credentials.

3. Verify Identity

diskd --json whoami

The output includes workspace and subject metadata decoded from the token. It does not print the token.

4. Pick a Project

List accessible projects:

diskd --json set-context --list

Set the current context by project name or id:

diskd set-context "Project Name"

Check the current context:

diskd get-context

Clear the project context and return to the workspace root:

diskd set-context --root

5. Upload and Read a File

printf 'hello diskd\n' > note.txt
diskd mkdir notes
diskd upload ./note.txt --dest notes --force
diskd ls notes
diskd cat notes/note.txt

6. Search

Exact or BM25 search:

diskd --json grep "hello diskd" notes

Semantic search:

diskd --json vsearch "greeting note" notes/note.txt --top 5

For semantic search, a specific file path is more reliable than a directory path when the Drive backend has not expanded directory inodes for vector search.

7. Query CSV or Spreadsheet Data

printf 'name,amount\nalpha,10\nbeta,20\n' > table.csv
diskd upload ./table.csv --dest notes --force
diskd --json biquery "what is the total amount?" notes/table.csv
diskd --json biquery "total amount grouped by name" notes/table.csv

biquery takes a natural-language question. Drive reads the spreadsheet schema, generates SQL internally, and returns the result table.

8. Query a Drive DB

Generic Drive DB:

diskd --json database query generic-db "SELECT id, text FROM messages LIMIT 20"

Typed Telegram Drive DB through the generic API:

diskd --json database query team-chat "SELECT id, text FROM messages LIMIT 20" --db-type telegram

Telegram-specific shortcut:

diskd --json telegram-db query team-chat "SELECT id, text FROM messages LIMIT 20"

Use database create, insert, commit, rollback, metadata, drop, and resolver commands for generic Drive DBs. Use telegram-db create, insert, commit, metadata, and drop for Telegram SQLite DB shortcuts.