Recognize more shell commands as code
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- shell, typescript
- Domain
- tooling
Research direction
Start in src/shared/classify.ts, where the SHELL_LINE regex used by looksLikeCode matches a line's leading command name and gives a bonus for flags. Add the listed tools (cargo, grep, tar, ssh, gh, scp, rsync, sed, awk, uv, deno, terraform, ffmpeg) without adding ambiguous English words like make, go, find or sort. Then extend the looksLikeCode tests in tests/classify.test.ts with positive cases and a prose sentence in the "leaves prose alone" test, and confirm pnpm test passes.
Written by the indexing model from the issue text.
Description
Code cards get a monospace font and a light syntax tint. One-line shell commands are recognized by how they start (git , npm , docker , kubectl …) plus a bonus point for flags, so docker ps -a is code. Lots of everyday tools aren't on the list, though, so these all land as plain text today:
cargo build --release
grep -rn foo .
tar -xzf file.tar.gz
ssh -i key.pem user@host
gh pr create --fill
Where to look
src/shared/classify.ts: theSHELL_LINEregex used bylooksLikeCodetests/classify.test.ts: thelooksLikeCodetests
Done when
- The commands above are detected as code. Other good candidates:
scp,rsync,sed,awk,uv,deno,terraform,ffmpeg - Prose still isn't. Leave out commands that are also everyday English words, like
make,go,findorsort: "make sure the app is closed" has to stay text. Add a sentence to the "leaves prose alone" test for anything borderline pnpm testpasses
Out of scope: commands without flags (git status) need more than one signal to count as code. That's deliberate, so leave it as it is.
Suggested pull request title: feat(classify): recognize more shell commands as code
New to OpenPaste? CONTRIBUTING.md covers setup, the code conventions and the checks to run before a pull request (pnpm typecheck, pnpm test, pnpm format, pnpm cleaner). Leave a comment if you're picking this up so nobody doubles up.
Generated by Claude Code
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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.
More from alexsilver8/openpaste
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
alexsilver8/openpaste#31 ·
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
alexsilver8/openpaste#32 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
alexsilver8/openpaste#30 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
alexsilver8/openpaste#29 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
alexsilver8/openpaste#27 ·
All issues in alexsilver8/openpaste
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/playwright#43327 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/TypeScript#64758 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
opensearch-project/OpenSearch-Dashboards#12937 ·
Maintainers usually reply within 2 days
-
Liveness marks block-included attesters live in the block's epoch instead of the attestation's epochOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
status: needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
a2ui-project/a2ui#3158 ·
Maintainers usually reply within 2 days