hashline

A safer, less error-prone alternative to patch/diff editing (e.g. apply_patch): reads files as LINE:HASH anchors and applies fail-fast, line-addressed edits.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "hashline" with this command: npx skills add tartavull/hashline/tartavull-hashline-hashline

Hashline Rust Tools

This skill provides a small CLI (hashline) that implements:

  • read: prints file contents with hashline prefixes LINE:HASH|content
  • edit: applies a list of hash-verified edits (set_line, replace_lines, insert_after, optional replace)

The goal is fail-fast edits: if the file changed since the agent last read it, anchors won’t match and the edit will be rejected.

Build

If hashline is already on your PATH (for example installed via Nix/Home Manager), skip this section.

Otherwise, from the skill directory:

cd ~/.codex/skills/hashline
cargo build

Binary path:

~/.codex/skills/hashline/target/debug/hashline

Read

hashline read path/to/file.txt

Optional:

hashline read path/to/file.txt --offset 10 --limit 50

Output format:

12:1a2b|some line content
13:9f00|next line

Use the LINE:HASH part (example 13:9f00) as anchors in edits.

Edit

Edits JSON can be either an array of edit objects, or an object with { "edits": [...] }.

1) Set (replace) a single line

hashline edit path/to/file.txt --edits-json '
[
  {"set_line": {"anchor": "3:abcd", "new_text": "replaced content"}}
]
'
  • new_text may contain \n to replace the single line with multiple lines.
  • new_text: "" deletes that line.

2) Replace a range of lines

hashline edit path/to/file.txt --edits-json '
[
  {"replace_lines": {"start_anchor": "5:aaaa", "end_anchor": "8:bbbb", "new_text": "new block\nsecond line"}}
]
'
  • new_text: "" deletes the whole range.

3) Insert after a line

hashline edit path/to/file.txt --edits-json '
[
  {"insert_after": {"anchor": "10:ccdd", "text": "inserted line"}}
]
'

4) Content replace (no anchors)

This is optional and runs after anchor-based edits.

hashline edit path/to/file.txt --edits-json '
[
  {"replace": {"old_text": "foo", "new_text": "bar", "all": true}}
]
'

Preview

hashline edit path/to/file.txt --edits-file edits.json --preview

Agent usage pattern

  1. hashline read <file>
  2. Select the exact line anchors you will target.
  3. Call hashline edit <file> --edits-json ... with those anchors.
  4. If you get a “changed since last read” error, re-read and retry with updated anchors.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Pdf To Markdown

PDF转Markdown工具。PDF文本转Markdown、表格识别转换、关键信息提取、格式美化修复、内容摘要、文档对比。PDF to Markdown converter with table recognition, info extraction, formatting, summarization, do...

Registry SourceRecently Updated
1910ckchzh
General

Partycraft

Provides customized event planning for weddings, birthdays, and corporate events, including budgets, checklists, invitations, timelines, and vendor lists.

Registry SourceRecently Updated
General

Orders

Orders - command-line tool for everyday use

Registry SourceRecently Updated
General

Option Calculator

期权计算器。期权定价、Greeks计算、策略组合、盈亏图、隐含波动率、行权分析。Option calculator with pricing, Greeks. 期权、衍生品。

Registry SourceRecently Updated