Agent-friendly UX: accept absolute paths in `--markdown @`, quieter / less repetitive proxy warning
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 17.3k
- Forks
- 1.4k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 105
Description
Agent-friendly UX: accept absolute paths in --markdown @, quieter / less repetitive proxy warning
Two small UX rough edges that disproportionately hurt AI agents and scripted callers:
1. --markdown @<path> rejects absolute paths
docs +update (and friends) accept --markdown @<path> to read content from a file. Today, the path is required to be relative to the current working directory:
$ lark-cli docs +update --doc "https://my.feishu.cn/wiki/<token>" \
--mode overwrite \
--markdown @/tmp/my-content.md
Error: --file must be a relative path within the current directory
For interactive users, this is mildly annoying. For AI coding agents (and other scripted callers), /tmp/<scratch>.md is the most natural and safe location to materialize intermediate content — they own no fixed cwd and shouldn't pollute the user's repo.
Workaround today: pipe to stdin via --markdown -. That works, but it loses the convenience of @<path> (e.g. you can no longer also use other stdin-consuming options on the same invocation).
Proposal: accept absolute paths under --markdown @<path>. If sandboxing is the concern, allow @/tmp/... and @$TMPDIR/... explicitly, or honor a LARK_CLI_ALLOW_ABSOLUTE_PATHS=1 env var.
2. The proxy warning prints on every single invocation
When https_proxy / http_proxy is set, lark-cli emits this on every command:
[lark-cli] [WARN] proxy detected: https_proxy=http://127.0.0.1:7897 — requests (including credentials) will transit through this proxy. Set LARK_CLI_NO_PROXY=1 to disable proxy.
The warning is a good one to surface — but it should fire once per session, not once per invocation. In an agent loop or a script that does N successive lark-cli calls, the warning dominates the output (especially when combined with the [deprecated] warning from #807). It also breaks jq pipelines that don't expect stderr-on-stdout interleaving in some terminals.
Proposals (one is enough):
a. Track first-emission per shell session via a sentinel file in $XDG_STATE_HOME/lark-cli or via a LARK_CLI_SESSION_ID env var; suppress the second-and-later warnings within a session.
b. Provide LARK_CLI_QUIET_PROXY=1 so scripted callers can opt out of the repeated warning after acknowledging it once.
c. At minimum, allow LARK_CLI_NO_PROXY_WARNING=1 (separate from LARK_CLI_NO_PROXY=1 — users may want to use the proxy but not be told about it on every call).
Environment
- lark-cli 1.0.27
- macOS, Node.js
- Encountered while doing batch wiki edits (a single workflow ran ~30 successive lark-cli commands; the warning fired 30 times).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the --markdown @ validation used by docs +update and the proxy warning emission for lark-cli commands. Compare the proposed absolute-path and warning-suppression approaches, then verify that the selected behavior accepts the intended paths and avoids repetitive warnings without disabling proxy use.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100