Skip to content

Latest commit

 

History

History
115 lines (84 loc) · 4.35 KB

README.md

File metadata and controls

115 lines (84 loc) · 4.35 KB

atomic-cli

crates.io Discord chat MIT licensed github

Status: Beta. Breaking changes are expected until 1.0.

A command-line application to create, read and interact with Atomic Data.

Designed and tested to work with atomic-server.

atomic-cli 0.23.2
Joep Meindertsma <joep@ontola.io>
Create, share, fetch and model Atomic Data!

USAGE:
    atomic-cli [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    destroy    Permanently removes a Resource.
    edit       Edit a single Atom from a Resource using your text editor.
    get        Get a Resource or Value by using Atomic Paths.
    help       Prints this message or the help of the given subcommand(s)
    list       List all bookmarks
    new        Create a Resource
    remove     Remove a single Atom from a Resource.
    set        Update a single Atom. Creates both the Resource if they don't exist. Overwrites existing.

Visit https://atomicdata.dev for more info

Installation

You can install `atomic-cli: in multiple ways:

Using Cargo

cargo install atomic-cli

Build from source

git clone git@github.com:ontola/atomic-server.git
cd atomic/cli
# Install atomic to path
cargo install --path ./

Usage

Run atomic-cli command --help for mor information about specific commands.

The write commands (set, remove, edit, destroy) require some authentication config, which needs to match with the target atomic-server. It reads the ~/.config/atomic/config.toml file. Create one with atomic-cli connect --server https://your-server: it makes a key on this machine and prints a link to your Atomic app, where you pick which drives it may reach and whether it may edit, and click Allow. Your own agent secret is never needed, and you can revoke the key under Connected apps in your account settings.

Features

  • A list command for showing local bookmarks (mappings)
  • A get command for finding resources and parts of data using Atomic Paths with various serialization options (JSON, JSON-AD, JSON-LD, Turtle, N-Triples, Pretty). Also supports path traversal.
  • set, remove, destroy and edit commands that send commits.
  • A new command for instantiating Atomic Classes

Config

Atomic creates a ~/.config/atomic folder, which contains a mapping.amp and a db. This folder is also used by atomic-server.

Mapping

The Mapping refers to your user specific set of shortname-URL combinations. This Mapping lives as a simple text file in ./user_mappping.amp.

person=https://atomicdata.dev/classes/Person

Development / contributing

If you want to run the commands from source, first run pnpm link --global and then exec the binary with pnpm exec ad-generate.