Publish from your terminal
Send a work to Valency from the folder it lives in, with two commands.
- valency initwrites valency.toml
- valency submituploads the folder
- Valency parses it
- Publish on the webfrom the link it prints
What you need #
- A folder with your LaTeX project or a built PDF.
- A terminal on macOS, Linux, or Windows. No Python or Node runtime is required.
- An access token from Settings › Access tokens, with Submit papers enabled.
Publish it #
- 1
Install
macOS and Linux curl -fsSL https://hub.valency.io/install.sh | shWindows (PowerShell) powershell -ExecutionPolicy ByPass -c "irm https://hub.valency.io/install.ps1 | iex"- Open a new terminal and run
valency --versionto verify the install. - To verify a release before running it, download the archive and its
.sha256file from GitHub releases and check it withsha256sum -corgh attestation verify. - PyPI, npm, and Homebrew are not supported yet. Do not use
pip install valency.
- Open a new terminal and run
- 2
Give it your token
macOS and Linux export VALENCY_TOKEN="paste-your-token-here"Windows (PowerShell) [Environment]::SetEnvironmentVariable("VALENCY_TOKEN", "paste-your-token-here", "User")- On macOS and Linux, add the
exportline to~/.zshrcor~/.bashrc. On Windows, run the PowerShell command once to save it for your user. - Open a new terminal. Never commit the token to your repository.
- On macOS and Linux, add the
- 3
Run init, dry run, and submit
In the folder with your work:
example session $ cd my-paper/ $ valency init ✓ Connected to Valency as [email protected] ✓ Drafted 3 authors from main.tex ? License: CC BY 4.0 ? Did AI contribute? Claude: Software ✓ Wrote valency.toml $ valency submit --dry-run ✓ 15 files · 2.4 MB archive · sha256 3f9c...e1 ✓ Valency accepts valency.toml $ valency submit ✓ Uploaded my-paper (main.tex, 14 figures) Finalized. Preview and publish it on Valency: https://hub.valency.io/submit/continue/7c1e2f0a - 4
Publish on the web
- Open the link
valency submitprints in your terminal. - Preview the rendered work and click Publish this version, as in Publish your first work.
- Open the link
Set up your repo #
To submit automatically from CI, keep your manuscript in your repository and configure it once. Choose the layout that matches your repo.
lake-ice-paper/
- .github/
- workflows/
- continuous.ymladded
- agent/
- update.mdadded
- analysis/
- fetch.py
- fit.py
- trend.py
- results.json
- data/
- lakes.csv
- paper/work
- main.tex
- sections/results.tex
- figures/fig3-trend.pdf
- valency.tomladded
- Makefile
- README.md
Blue: the work. Green: what you add for Valency.
# Generated by `valency init`. Replace placeholders before submitting.
schema_version = 1
license = "CC-BY-4.0"
attested = false # set to true only after confirming authorship
[fields]
primary = "hydrology"
[[authors]]
given_names = "<your-given-name>"
family_name = "<your-family-name>"
email = "<[email protected]>"
me = true
[ai]
none = true
[ancillary]
answer = "no"
valency init paper/
Connected to Valency as [email protected]
Drafted 3 authors from paper/main.tex
? License CC BY 4.0
? AI contributions none
Wrote paper/valency.toml
A token that can only submit
- Submit new versions
- Read your works' status
- Publish versions · you approve on the web
- Delete versions
Add it to your CI secrets as VALENCY_TOKEN.
name: Submit to Valency
on:
repository_dispatch:
types: [new-lake-record] # your listener sends this
schedule:
- cron: "17 3 * * *" # and a nightly catch-up
permissions:
contents: read
env:
OUTPUTS: "paper data analysis/*.json CLAIMS.md :!paper/valency.toml" # the work's outputs
jobs:
rebuild: # your scripts and agent: no tokens
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.rewrite.outputs.changed }}
note: ${{ steps.rewrite.outputs.note }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false # keep the GitHub token out of .git/config
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
- run: pip install -r requirements.txt
- name: New data lands
run: make fetch-data
- name: Analysis runs
run: make analysis
- name: The work is rewritten
id: rewrite
run: |
make paper
git add -A # new outputs too
set -f # git, not the shell, reads the patterns
git diff --quiet HEAD -- $OUTPUTS && exit 0 # nothing new tonight
git diff --binary HEAD -- $OUTPUTS > rewrite.patch # staged or not
echo "note=Add $(head -n 1 data/latest.txt) to the sample" >> "$GITHUB_OUTPUT"
echo "changed=true" >> "$GITHUB_OUTPUT"
- if: steps.rewrite.outputs.changed == 'true'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: rewrite
path: rewrite.patch
publish: # git and the pinned CLI: the tokens
needs: rebuild
if: needs.rebuild.outputs.changed == 'true'
runs-on: ubuntu-latest
permissions:
contents: write # for Push to GitHub
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Install valency (SHA-256 verified)
shell: bash
env:
VALENCY_VERSION: v0.1.0-rc.3
VALENCY_SHA256: 1ab69fb7f626b622cb47339a5848c31ac1a8f576f15e21cf249f0892c31ada2b
run: |
archive="$RUNNER_TEMP/valency.tar.xz"
curl -fsSL -o "$archive" "https://github.com/valency-oss/valency-cli/releases/download/$VALENCY_VERSION/valency-x86_64-unknown-linux-musl.tar.xz"
echo "$VALENCY_SHA256 $archive" | sha256sum -c -
mkdir -p "$RUNNER_TEMP/bin"
tar -xJf "$archive" -C "$RUNNER_TEMP/bin" --strip-components=1 --wildcards "*/valency"
echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH"
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: rewrite
path: ${{ runner.temp }}/rewrite # outside the checkout
- name: Take the rewrite
run: |
set -f
git apply --index "$RUNNER_TEMP/rewrite/rewrite.patch" # git refuses any path in .git/
test -z "$(git diff --cached --raw --no-renames | grep -E '^:[0-7]{6} (120000|160000) ')" # no links
test "$(git diff --cached --name-only --no-renames)" = \
"$(git diff --cached --name-only --no-renames -- $OUTPUTS)" # the outputs, nothing else
- name: Push to GitHub
env:
GH_TOKEN: ${{ github.token }}
NOTE: ${{ needs.rebuild.outputs.note }} # text from rebuild, never run or read here
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "$NOTE"
git push "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}" HEAD
- name: Push to Valency
env:
VALENCY_TOKEN: ${{ secrets.VALENCY_TOKEN }} # scope: Submit papers
run: |
for attempt in 1 2 3; do
status=0
valency submit paper/ --yes --json --wait 10m || status=$?
[ "$status" -ne 75 ] && exit "$status"
sleep 120
done
exit 75
The numbers in the margin match the steps of the example flow.
- Valency reads the .tex file containing \documentclass and \begin{document}. Keep your code and data in the repo and link them from the work.
- The workflow runs when your listener sends new-lake-record, and nightly. Editing the README does not create a version.
- Your scripts and agent run in rebuild, which holds no token. publish installs valency, applies the diff only if it touches OUTPUTS with no symlinks, then pushes and submits a draft.
- Pin both VALENCY_VERSION and VALENCY_SHA256 (from the release's .sha256 asset) in .github/workflows/continuous.yml so the token-bearing job verifies the archive digest before extracting valency, and require code review on changes to .github/workflows/ (CODEOWNERS).
- After the first submit, commit the
[hub]table invalency.toml(or pass--work <WORK_ID>) so future runs submit new versions instead of creating a new work. - Submissions count toward your account's daily submission limit, shared with web uploads.
Send a new version #
- Edit your work, then run
valency submitagain in the same folder. - It detects what changed and asks you to confirm a new version.
- The new version stays private until you publish it on the web.
- Valency numbers versions for you: the first publish is
1.0.0, and each publish after it takes the next major number,2.0.0, then3.0.0. See Versions, DOIs & citing.
To send a version from CI, see Publish from Terminal for examples.
Command reference #
| Command | What it does |
|---|---|
valency init [DIR] | Checks your token, drafts authors from LaTeX, asks the submission questions, and writes valency.toml. |
valency authors draft|show [DIR] | Drafts the author list from LaTeX with Valency and saves it, or prints the saved author list in valency.toml. |
valency authors import FILE [DIR] | Imports an author list from a JSON file, or from stdin with -, into valency.toml. |
valency submit --dry-run [DIR] | Lists packed files and archive SHA-256, validates valency.toml, and prints what submit would do without uploading. |
valency submit [DIR] | Packs and uploads the folder, resumes if stopped, and prints a link to preview and publish the draft. |
valency status [DIR] | Reads where the work stands on Valency without changing anything. |
valency skill install [--global] | Installs the built-in agent skill for Claude Code, Codex, and other coding agents. |
valency upgrade | Updates valency to the latest stable release. |
| Option | What it does |
|---|---|
--yes | Answers yes to prompts for CI and scripts. Never answers duplicate prompts. |
--wait 10m | Stops after the duration and exits 75. Run the same command again to resume. |
--work <WORK_ID> | Submits a new version of an existing work when valency.toml has no [hub] table. |
--pdf FILE | --tex FILE | Chooses a single PDF or a specific LaTeX main file inside the folder. |
--answer-duplicate <ANSWER> | Answers a possible-duplicate prompt (new-version, different-work, or request-work) with --duplicate-work. |
--json | Writes one JSON object to stdout for scripts and agents. |
| File or variable | What it is |
|---|---|
VALENCY_TOKEN | Your access token. In CI, save it as a repository secret with this name. |
valency.toml | Stores your license, fields, authors, AI contributions, attestation, and the [hub] pointer that links the folder to Valency. |
.hubignore | Excludes extra files from the upload archive using .gitignore syntax. |
What it can't do yet #
- Markdown, Quarto, or Jupyter manuscripts. Submit LaTeX or a built PDF.
- Uploading Lean proofs or ancillary data. Link them at a public URL instead.
- Publishing from the terminal. Preview and publish each version on the web.
- PyPI, npm, and Homebrew packages. Install with curl or PowerShell; pip install valency installs only an empty placeholder.
- macOS notarization. Installing with curl works, but browser-downloaded archives are blocked by Gatekeeper.