Something went wrong. Try again.
A CLI tool to post to Grain.social
Something went wrong. Try again.
AGENTS.md #
This file explains how to work on grain as a contributor/agent, while keeping the user experience simple.
Product intent #
grain should feel like a straightforward uploader for Grain.social:
- Sign in
- Add photos
- Add title/description/alt text
- Publish
Default to user-facing language. Mention protocol details only when they are needed for debugging or security context.
UX rules #
- Prefer plain wording over implementation details.
- Good: "secure browser login"
- Avoid in general help copy: "ATProto OAuth loopback flow"
- Keep command help concise.
- Keep upload success output focused on:
- gallery URL
- library URL
- critical warnings only
- If auto-recovery happens (for odd image formats), log one concise line per file.
Login/session behavior #
grain loginmust use browser-based login.- Logging in to a different account should replace active account and revoke previous active session when possible.
grain logoutclears local session state.
Media handling behavior #
- Accept local paths and remote URLs.
@pathis required in wizard media entry, but CLI flags can pass local paths directly.- EXIF mode:
- default
include - optional
exclude
- default
- Upload flow must be resilient:
- if EXIF parsing fails: continue without EXIF for that file
- if metadata stripping fails: normalize image and continue
- if dimensions are unreadable: attempt fallback normalization and continue
- fail only when file cannot be made uploadable
Alt text behavior #
- Manual alt text should always be supported.
- AI alt is optional.
- If AI alt fails and fallback prompting is available, ask user for manual alt.
Docs expectations #
- README should optimize for first-run success.
- Put quick start first.
- Keep security section practical and short.
- Keep protocol internals in this file or deeper docs, not front-and-center in README/help.
Release/update flow #
Versioning standard (required) #
- Use semantic versioning in
package.jsonasx.y.z. - Increment rules:
x(major): breaking behavior or incompatible command changes.y(minor): new features that are backward-compatible.z(patch): bug fixes, docs updates, and non-breaking polish.
- Any user-facing release to GitHub/Tangled must include an intentional version decision.
grain updateoutput should stay plain-language and user-facing (not implementation jargon).
When shipping user-facing changes:
- Run
bun run check. - Bump
package.jsonversion according to semantic versioning. - Keep README aligned with actual CLI behavior.
- Push to GitHub
main. - Mirror same
mainto Tangled remote.