anytype-cli

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2025 License: MIT Imports: 2 Imported by: 0

README

Anytype CLI

A command-line interface for interacting with Anytype. This CLI includes an embedded gRPC server from anytype-heart, making it a complete, self-contained solution for developers to work with Anytype.

Quick Start

# Build the CLI (includes embedded server)
make build

# Install the CLI
make install

# Run the Anytype server
anytype serve

Installation

Install the latest release with a single command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/anyproto/anytype-cli/HEAD/install.sh)"
Build from Source
Prerequisites
  • Go 1.20 or later
  • Git
  • Make
  • C++ compiler (for tantivy library)
Build and Install
# Build only (automatically downloads tantivy library)
make build

# Build and install system-wide (may require sudo)
make install

# Build and install to ~/.local/bin (no sudo required)
make install-local
Uninstall
# Remove system-wide installation
make uninstall

# Remove user-local installation
make uninstall-local

Usage

anytype <command> <subcommand> [flags]

Commands:
  auth        Authenticate with Anytype
  serve       Run the Anytype server
  service     Manage Anytype as a system service
  shell       Start the Anytype interactive shell
  space       Manage spaces
  update      Update anytype CLI to the latest version
  version     Show version information

Examples:
  anytype serve                     # Run server in foreground
  anytype service install           # Install as system service
  anytype service start             # Start the service
  anytype auth login                # Login with mnemonic
  anytype space list                # List available spaces

Use "anytype <command> --help" for more information about a command.
Running the Server

The CLI includes an embedded gRPC server that can be run in two ways:

1. Interactive Mode (for development)
anytype serve

This runs the server in the foreground with logs output to stdout, similar to ollama serve.

2. System Service (for production)
# Install as system service
anytype service install

# Start the service
anytype service start

# Check service status
anytype service status

# Stop the service
anytype service stop

# Uninstall the service
anytype service uninstall

The service management works across platforms:

  • macOS: Uses launchd
  • Linux: Uses systemd/upstart/sysv
  • Windows: Uses Windows Service
Authentication

After starting the server, authenticate with your Anytype account:

# Login with mnemonic
anytype auth login

# Check authentication status
anytype auth status

# Logout
anytype auth logout
API Keys

Generate API keys for programmatic access:

# Create a new API key
anytype auth apikey create --name "my-app"

# List API keys
anytype auth apikey list

# Revoke an API key
anytype auth apikey revoke <key-id>

Development

Project Structure
anytype-cli/
├── cmd/              # CLI commands
│   ├── auth/         # Authentication commands
│   ├── serve/        # Server command
│   ├── service/      # Service management
│   ├── space/        # Space management
│   └── ...
├── core/             # Core business logic
│   ├── grpcserver/   # Embedded gRPC server
│   ├── serviceprogram/ # Service implementation
│   └── ...
└── dist/             # Build output
Building from Source
# Clone the repository
git clone https://github.com/anyproto/anytype-cli.git
cd anytype-cli

# Build (CGO is automatically enabled for tantivy)
make build

# Run tests
go test ./...

# Run linting
make lint

Contribution

Thank you for your desire to develop Anytype together!

❤️ This project and everyone involved in it is governed by the Code of Conduct.

🧑‍💻 Check out our contributing guide to learn about asking questions, creating issues, or submitting pull requests.

🫢 For security findings, please email security@anytype.io and refer to our security guide for more information.

🤝 Follow us on Github and join the Contributors Community.


Made by Any — a Swiss association 🇨🇭

Licensed under MIT.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL