CodeEditApp / CodeEditApp/CodeEditCLI

Add support for piping input to CodeEdit via CLI

未关闭
#34 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Swift
星标
81
派生
19
PR 合并指标
30 天内没有已合并 PR

描述

The `codeedit` CLI currently does not support receiving input via pipe (`|`). Introducing this feature would allow developers to seamlessly use the `codeedit` CLI to interact with the CodeEdit app, enabling workflows similar to those supported by other editors, such as Sublime Text's `subl` CLI, which supports piping input directly into the editor.

### Use Case

Developers often use CLI tools to process text and may want to quickly edit the output in CodeEdit. For example:

```sh
echo "Sample text" | codeedit
```

With this feature, the `codeedit` CLI would behave similarly to `subl` from Sublime Text, opening a new tab or window in CodeEdit with the piped content for editing.

### Benefits

- Expands the utility of the `codeedit` CLI in developer workflows.
- Positions CodeEdit as a competitive choice alongside editors like Sublime Text.
- Enables seamless integration with terminal-based pipelines.

### Suggested Implementation

1. **Input Detection:**
The `codeedit` CLI should recognize when input is piped into it.

2. **Temporary File Handling:**
Create a temporary file containing the piped input and open it in CodeEdit.

3. **Optional Flag:**
Provide a `--pipe` flag to explicitly handle piped input, similar to how `subl` operates.

### Example

```sh
# Open piped text in CodeEdit
echo "Edit this text" | codeedit

# Example from Sublime Text for comparison
echo "Edit this text" | subl
```

### Additional Considerations

- **Temporary File Management:** Ensure that temporary files are removed after the editing session ends.
- **Efficient Input Handling:** Handle large piped inputs efficiently to avoid performance bottlenecks.
- **Custom Options:** Allow configuring how piped input is managed (e.g., open in a new tab, new window, or append to an existing file).

----

By adopting a similar approach as `subl`, CodeEdit could provide a familiar and powerful experience for developers, while leveraging CodeEdit's unique features and interface.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start by locating the codeedit CLI entry point and its existing argument and file-opening handling. Reproduce the documented echo pipeline, then define how piped input is detected, represented as a temporary file, opened in CodeEdit, and cleaned up after editing; done means the example workflow works without disrupting normal file and folder arguments.

由索引模型根据 Issue 内容生成。

评估

技术栈
swift
领域
cli
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。