Skip to main content

elport: a git-like sync CLI for eLabFTW

English | 日本語

Write lab notes locally in Markdown, with inline HTML like <figure> where you want it. Then push/pull them, along with every figure and data file the body references, to eLabFTW entities. Local is the source of truth.

Install

Python 3.10+, installed as a uv tool (provides the elport command):

uv tool install elport    # upgrade: uv tool upgrade elport

Or as a conda global tool, on conda 26.10 or later:

conda install -c conda-forge "conda-global>=0.2"
conda global ensurepath
conda global install elport -c conda-forge -c conda-pypi    # upgrade: conda global update

Or with pip:

pip install elport        # upgrade: pip install -U elport

The core idea

One local file maps to one eLabFTW entry: Markdown with a YAML front matter block, inline HTML allowed.

On push, elport uploads every real local file the body references, in any notation and anywhere on disk (../data/raw.csv and absolute paths work; hidden files never go up), and swaps each path for its real eLabFTW URL. The body goes up as raw Markdown, so <figure> and $...$ render as-is. To link another entry instead of uploading, write its eLabFTW URL or its local document's path. Code fences, inline code, and HTML comments are never parsed.

Quick start

elport login labA                       # store base_url (config) + api_key (OS keyring), interactively
elport list                             # what do I already have on the server? (read-only)
elport new "CRISPR titration"           # create the entity, scaffold report.md with id
# ...or edit an entity made in the Web UI: elport clone <id> (to only read it: elport view <id>)
# ...edit report.md, drop fig1.png / data.csv next to it...
elport status                           # what would sync? (read-only)
elport push                             # upload references + push the body

Writing a note

---
id: 42                    # written by elport new or the first push
title: CRISPR titration
tags: [CRISPR]
---

# Result

![titration curve](fig1.png)

Raw data: [raw.csv](data/raw.csv)

elport new writes the front matter for you. Write the body as usual and reference local files by their path, and push uploads them. elport help documents lists every front matter key and reference rule.

Commands

Commands that act on a local document take an optional [<doc>], defaulting to report.md. Any name works. Sync commands also take a directory: every elport document under it, one line each. Exit code 0 on success, 1 on failure. Run elport <command> --help for the full flags.

Sync

Command Summary
push Upload the body and its referenced files to one entity.
pull Fetch the body and metadata, and download referenced files.
fetch Download every attachment, referenced or not. Read-only.
status Report what would sync, and in which mode. Read-only.
diff Diff local against remote, or against the last push with --base.
merge Merge .base.md and .remote.md into <doc> after a conflict. Requires git.

push creates the entity and writes id back to the front matter when id is unset, and it runs the mode and conflict checks first. merge is local-only: it runs git merge-file, so git must be installed, but the folder need not be a git repository.

Entities

Command Summary
new "<title>" Create an entity and scaffold front matter.
clone <id> Start <doc> to edit and push an entity that already exists, then pull. To only read one, use view.
clone --all <dir> Back up every entity into <dir>. Re-run to add new ones. An HTML entity is saved as view -o writes it.
list List remote entities as id date title. Read-only. --order lastchange or --order comment shows that time instead of the date.
view <id> Read one remote entity: print its body to stdout, made readable. Read-only. An HTML entity loses its styling, and attachments appear by file name. Links to and from it are listed on stderr.
view <id> -o <dir> Read it with all its attachments, saved into a new or empty <dir>. Not a working copy.
activity Heatmap of the entities you created per day, up to a year as the terminal width allows. --team gives one per author.
comments [<id>] Print the remote comment thread. With an <id>, no local document is needed.
comment "<text>" Post one comment. Use the Web UI to edit or delete.

new and clone write to report.md unless you pass -o <doc>. list defaults to your own entities (--scope self) and returns 50 at a time, with -q <term>, --tag <tag>, --limit, --offset, and --json to narrow it; --all pages through every result. -q also takes the Web UI's search fields, such as -q 'author:"Jane Doe" status:"Success"'. --order and --sort asc|desc pick the order, as the Web UI's Sort menu does: elport list --scope team --order comment puts the team's latest comments first. comments prints to the terminal only, never into the body.

An entity written in the Web UI's rich text editor stores HTML. elport only reads it: clone, pull, and push refuse it, and view -o is the way to read it with its figures.

Setup

Command Summary
login [<profile>] Store base_url in config.toml, api_key in the OS keyring.
logout [<profile>] Remove the stored api_key. Keeps base_url.
profile [use <name>] List profiles, or set the default one.
whoami Check auth: user, team, role, key permissions, server version, scopes.

Shared options

  • -n/--dry-run rehearses a push without sending.
  • -f/--force pushes over a changed remote, losing the Web-side change.
  • -y/--yes skips the two confirmations: widening read/write beyond your team, and new uploads over 25 MiB. A non-interactive run needs -y for either.
  • --profile <name> and --entity {experiments,items} pick the destination.

Documents, sync, and conflicts

The details ship with the CLI, so they match the version you installed:

  • elport help documents: front matter, references, attachments, links between notes (on GitHub)
  • elport help workflow: the status, diff, push loop, conflicts, pull and fetch (on GitHub)
  • elport help agents: what an AI agent asks its user before acting (on GitHub)

Configuration & auth

No credentials in the project.

Where the key lives

elport login stores the API key in your OS keyring: Keychain, Credential Manager, or Secret Service. Everything that is not a secret, base_url included, goes in ~/.config/elport/config.toml with mode 600. elport never prints the key, and refuses a base_url that is not https://.

# ~/.config/elport/config.toml
default_profile = "labA"

[profiles.labA]
base_url   = "https://lab-a.example.org"
verify_ssl = true

Which credentials win

elport checks three sources, in order, and stops at the first hit.

  1. ELABFTW_BASE_URL + ELABFTW_API_KEY in the environment. This is how CI authenticates.
  2. The keyring and config pair from elport login. The normal default.
  3. A plaintext key in ~/.config/elport/config.toml. A last resort, used with a warning, and only when no keyring backend exists (e.g. WSL, headless servers).

Profiles

Profiles layer like settings.json, one per team:

~/.config/elport/config.toml  →  <project>/.elport.toml  →  <dir>/.elport.toml

Your first elport login becomes the default. elport profile use <name> switches it, or set profile: in a note's front matter to pin that one file.

.elportignore

.elportignore excludes referenced files inside the document directory, .gitignore-style, so they are never uploaded. It is additive across the same layers as profiles, plus every .elportignore from the project root down to the document directory. Each pattern is anchored at its own directory.

Learn more

  • Why it works this way → docs/DESIGN.md
  • How eLabFTW's API actually behaves → docs/ELABFTW-API.md
  • The behavioral contract → the test suite (tests/) is authoritative
  • Driving elport from an AI agent → elport help agents. The skill in skills/elport/SKILL.md only points there.

Development

Module Role
cli.py Argument parsing and dispatch
sync.py push, pull, status, diff, view
transclude.py Path ↔ URL rewriting, both directions
client.py eLabFTW API wrapper
state.py The stored base and its hashes
config.py Profiles and credential resolution
frontmatter.py The YAML block
browse.py list and activity
help/*.md Topics printed by elport help

The tests are the authoritative behavioral contract, so change tests first. You can check live API behavior against https://demo.elabftw.net.

Acknowledgments

License

MIT

Metadata

Release files for elport 0.1.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elport 0.1.12
File Size Uploaded Provenance Actions
elport-0.1.12.tar.gz 186.7 kB Without provenance Details for elport-0.1.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for elport 0.1.12
File Interpreter ABI Platform Actions
elport-0.1.12-py3-none-any.whl Python 3 none any Details for elport-0.1.12-py3-none-any.whl

Total release size: 240.9 kB

Release files / elport-0.1.12.tar.gz

Download URL elport-0.1.12.tar.gz
Size 186.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c472f5c0d778fbe8d4add78ced9bb7cb99af051699278fdc8c2716a665a1ab7e
BLAKE2b-256 checksum
How to use checksums
ba718056562ef79a553536061388fbde51ec3e35069bfd25c83f4e23dbdf397f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / elport-0.1.12-py3-none-any.whl

Download URL elport-0.1.12-py3-none-any.whl
Size 54.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6dd32cc5e19fc6b20e54731bc5c23fb815683be8d6ca94a1a14b82aee649d1c
BLAKE2b-256 checksum
How to use checksums
0b57f1be9a0b1fd8a59b9f9fe6e2d330acddff52be7339d93994004c808b2a91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for elport 0.1.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page