Compare commits
1 Commits
dev
...
opencode/m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
184b6d0117 |
59
.github/workflows/docs-locale-sync.yml
vendored
@@ -12,14 +12,13 @@ jobs:
|
||||
if: github.actor != 'opencode-agent[bot]'
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.ref_name }}
|
||||
|
||||
- name: Setup Bun
|
||||
uses: ./.github/actions/setup-bun
|
||||
@@ -52,54 +51,9 @@ jobs:
|
||||
uses: sst/opencode/github@latest
|
||||
env:
|
||||
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
|
||||
GITHUB_TOKEN: ${{ steps.committer.outputs.token }}
|
||||
OPENCODE_CONFIG_CONTENT: |
|
||||
{
|
||||
"permission": {
|
||||
"*": "deny",
|
||||
"read": {
|
||||
"*": "deny",
|
||||
"packages/web/src/content/docs": "allow",
|
||||
"packages/web/src/content/docs/*": "allow",
|
||||
"packages/web/src/content/docs/*.mdx": "allow",
|
||||
"packages/web/src/content/docs/*/*.mdx": "allow",
|
||||
".opencode": "allow",
|
||||
".opencode/agent": "allow",
|
||||
".opencode/agent/glossary": "allow",
|
||||
".opencode/agent/translator.md": "allow",
|
||||
".opencode/agent/glossary/*.md": "allow"
|
||||
},
|
||||
"edit": {
|
||||
"*": "deny",
|
||||
"packages/web/src/content/docs/*/*.mdx": "allow"
|
||||
},
|
||||
"glob": {
|
||||
"*": "deny",
|
||||
"packages/web/src/content/docs*": "allow",
|
||||
".opencode/agent/glossary*": "allow"
|
||||
},
|
||||
"task": {
|
||||
"*": "deny",
|
||||
"translator": "allow"
|
||||
}
|
||||
},
|
||||
"agent": {
|
||||
"translator": {
|
||||
"permission": {
|
||||
"*": "deny",
|
||||
"read": {
|
||||
"*": "deny",
|
||||
".opencode/agent/translator.md": "allow",
|
||||
".opencode/agent/glossary/*.md": "allow"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
with:
|
||||
model: opencode/gpt-5.3-codex
|
||||
model: opencode/gpt-5.2
|
||||
agent: docs
|
||||
use_github_token: true
|
||||
prompt: |
|
||||
Update localized docs to match the latest English docs changes.
|
||||
|
||||
@@ -113,11 +67,10 @@ jobs:
|
||||
2. You MUST use the Task tool for translation work and launch subagents with subagent_type `translator` (defined in .opencode/agent/translator.md).
|
||||
3. Do not translate directly in the primary agent. Use translator subagent output as the source for locale text updates.
|
||||
4. Run translator subagent Task calls in parallel whenever file/locale translation work is independent.
|
||||
5. Use only the minimum tools needed for this task (read/glob, file edits, and translator Task). Do not use shell, web, search, or GitHub tools for translation work.
|
||||
6. Preserve frontmatter keys, internal links, code blocks, and existing locale-specific metadata unless the English change requires an update.
|
||||
7. Keep locale docs structure aligned with their corresponding English pages.
|
||||
8. Do not modify English source docs in packages/web/src/content/docs/*.mdx.
|
||||
9. If no locale updates are needed, make no changes.
|
||||
5. Preserve frontmatter keys, internal links, code blocks, and existing locale-specific metadata unless the English change requires an update.
|
||||
6. Keep locale docs structure aligned with their corresponding English pages.
|
||||
7. Do not modify English source docs in packages/web/src/content/docs/*.mdx.
|
||||
8. If no locale updates are needed, make no changes.
|
||||
|
||||
- name: Commit and push locale docs updates
|
||||
if: steps.changes.outputs.has_changes == 'true'
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
# Locale Glossaries
|
||||
|
||||
Use this folder for locale-specific translation guidance that supplements `.opencode/agent/translator.md`.
|
||||
|
||||
The global glossary in `translator.md` remains the source of truth for shared do-not-translate terms (commands, code, paths, product names, etc.). These locale files capture community learnings about phrasing and terminology preferences.
|
||||
|
||||
## File Naming
|
||||
|
||||
- One file per locale
|
||||
- Use lowercase locale slugs that match docs locales when possible (for example, `zh-cn.md`, `zh-tw.md`)
|
||||
- If only language-level guidance exists, use the language code (for example, `fr.md`)
|
||||
- Some repo locale slugs may be aliases/non-BCP47 for consistency (for example, `br` for Brazilian Portuguese / `pt-BR`)
|
||||
|
||||
## What To Put In A Locale File
|
||||
|
||||
- **Sources**: PRs/issues/discussions that motivated the guidance
|
||||
- **Do Not Translate (Locale Additions)**: locale-specific terms or casing decisions
|
||||
- **Preferred Terms**: recurring UI/docs words with preferred translations
|
||||
- **Guidance**: tone, style, and consistency notes
|
||||
- **Avoid** (optional): common literal translations or wording we should avoid
|
||||
- If the repo uses a locale alias slug, document the alias in **Guidance** (for example, prose may mention `pt-BR` while config/examples use `br`)
|
||||
|
||||
Prefer guidance that is:
|
||||
|
||||
- Repeated across multiple docs/screens
|
||||
- Easy to apply consistently
|
||||
- Backed by a community contribution or review discussion
|
||||
|
||||
## Template
|
||||
|
||||
```md
|
||||
# <locale> Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #12345: https://github.com/anomalyco/opencode/pull/12345
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
| English | Preferred | Notes |
|
||||
| ------- | --------- | --------- |
|
||||
| prompt | ... | preferred |
|
||||
| session | ... | preferred |
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural phrasing over literal translation
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid ... when ...
|
||||
```
|
||||
|
||||
## Contribution Notes
|
||||
|
||||
- Mark entries as preferred when they may evolve
|
||||
- Keep examples short
|
||||
- Add or update the `Sources` section whenever you add a new rule
|
||||
- Prefer PR-backed guidance over invented term mappings; start with general guidance if no term-level corrections exist yet
|
||||
@@ -1,28 +0,0 @@
|
||||
# ar Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #9947: https://github.com/anomalyco/opencode/pull/9947
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Commands, flags, file paths, and code literals (keep exactly as written)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural Arabic phrasing over literal translation
|
||||
- Keep tone clear and direct in UI labels and docs prose
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
- For RTL text, treat code, commands, and paths as LTR artifacts and keep their character order unchanged
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid translating product and protocol names that are fixed identifiers
|
||||
- Avoid mixing multiple Arabic terms for the same recurring UI action once a preferred term is established
|
||||
@@ -1,34 +0,0 @@
|
||||
# br Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #10086: https://github.com/anomalyco/opencode/pull/10086
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Locale code `br` in repo config, code, and paths (repo alias for Brazilian Portuguese)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
These are PR-backed locale naming preferences and may evolve.
|
||||
|
||||
| English / Context | Preferred | Notes |
|
||||
| ---------------------------------------- | ------------------------------ | ------------------------------------------------------------- |
|
||||
| Brazilian Portuguese (prose locale name) | `pt-BR` | Use standard locale naming in prose when helpful |
|
||||
| Repo locale slug (code/config) | `br` | PR #10086 uses `br` for consistency/simplicity |
|
||||
| Browser locale detection | `pt`, `pt-br`, `pt-BR` -> `br` | Preserve this mapping in docs/examples about locale detection |
|
||||
|
||||
## Guidance
|
||||
|
||||
- This file covers Brazilian Portuguese (`pt-BR`), but the repo locale code is `br`
|
||||
- Use natural Brazilian Portuguese phrasing over literal translation
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
- Keep repo locale identifiers as implemented in code/config (`br`) even when prose mentions `pt-BR`
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid changing repo locale code references from `br` to `pt-br` in code snippets, paths, or config examples
|
||||
- Avoid mixing Portuguese variants when a Brazilian Portuguese form is established
|
||||
@@ -1,33 +0,0 @@
|
||||
# bs Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #12283: https://github.com/anomalyco/opencode/pull/12283
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Commands, flags, file paths, and code literals (keep exactly as written)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
These are PR-backed locale naming preferences and may evolve.
|
||||
|
||||
| English / Context | Preferred | Notes |
|
||||
| ---------------------------------- | ---------- | ------------------------------------------------- |
|
||||
| Bosnian language label (UI) | `Bosanski` | PR #12283 tested switching language to `Bosanski` |
|
||||
| Repo locale slug (code/config) | `bs` | Preserve in code, config, paths, and examples |
|
||||
| Browser locale detection (Bosnian) | `bs` | PR #12283 added `bs` locale auto-detection |
|
||||
|
||||
## Guidance
|
||||
|
||||
- Use natural Bosnian phrasing over literal translation
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
- Keep repo locale references as `bs` in code/config, and use `Bosanski` for the user-facing language name when applicable
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid changing repo locale references from `bs` to another slug in code snippets or config examples
|
||||
- Avoid translating product and protocol names that are fixed identifiers
|
||||
@@ -1,27 +0,0 @@
|
||||
# da Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #9821: https://github.com/anomalyco/opencode/pull/9821
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Commands, flags, file paths, and code literals (keep exactly as written)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural Danish phrasing over literal translation
|
||||
- Keep tone clear and direct in UI labels and docs prose
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid translating product and protocol names that are fixed identifiers
|
||||
- Avoid mixing multiple Danish terms for the same recurring UI action once a preferred term is established
|
||||
@@ -1,27 +0,0 @@
|
||||
# de Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #9817: https://github.com/anomalyco/opencode/pull/9817
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Commands, flags, file paths, and code literals (keep exactly as written)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural German phrasing over literal translation
|
||||
- Keep tone clear and direct in UI labels and docs prose
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid translating product and protocol names that are fixed identifiers
|
||||
- Avoid mixing multiple German terms for the same recurring UI action once a preferred term is established
|
||||
@@ -1,27 +0,0 @@
|
||||
# es Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #9817: https://github.com/anomalyco/opencode/pull/9817
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Commands, flags, file paths, and code literals (keep exactly as written)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural Spanish phrasing over literal translation
|
||||
- Keep tone clear and direct in UI labels and docs prose
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid translating product and protocol names that are fixed identifiers
|
||||
- Avoid mixing multiple Spanish terms for the same recurring UI action once a preferred term is established
|
||||
@@ -1,27 +0,0 @@
|
||||
# fr Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #9821: https://github.com/anomalyco/opencode/pull/9821
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Commands, flags, file paths, and code literals (keep exactly as written)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural French phrasing over literal translation
|
||||
- Keep tone clear and direct in UI labels and docs prose
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid translating product and protocol names that are fixed identifiers
|
||||
- Avoid mixing multiple French terms for the same recurring UI action once a preferred term is established
|
||||
@@ -1,33 +0,0 @@
|
||||
# ja Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #9821: https://github.com/anomalyco/opencode/pull/9821
|
||||
- PR #13160: https://github.com/anomalyco/opencode/pull/13160
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Commands, flags, file paths, and code literals (keep exactly as written)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
These are PR-backed wording preferences and may evolve.
|
||||
|
||||
| English / Context | Preferred | Notes |
|
||||
| --------------------------- | ----------------------- | ------------------------------------- |
|
||||
| WSL integration (UI label) | `WSL連携` | PR #13160 prefers this over `WSL統合` |
|
||||
| WSL integration description | `WindowsのWSL環境で...` | PR #13160 improved phrasing naturally |
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural Japanese phrasing over literal translation
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
- In WSL integration text, follow PR #13160 wording direction for more natural Japanese phrasing
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid `WSL統合` in the WSL integration UI context where `WSL連携` is the reviewed wording
|
||||
- Avoid translating product and protocol names that are fixed identifiers
|
||||
@@ -1,27 +0,0 @@
|
||||
# ko Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #9817: https://github.com/anomalyco/opencode/pull/9817
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Commands, flags, file paths, and code literals (keep exactly as written)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural Korean phrasing over literal translation
|
||||
- Keep tone clear and direct in UI labels and docs prose
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid translating product and protocol names that are fixed identifiers
|
||||
- Avoid mixing multiple Korean terms for the same recurring UI action once a preferred term is established
|
||||
@@ -1,38 +0,0 @@
|
||||
# no Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #10018: https://github.com/anomalyco/opencode/pull/10018
|
||||
- PR #12935: https://github.com/anomalyco/opencode/pull/12935
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Sound names (PR #10018 notes these were intentionally left untranslated)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
These are PR-backed corrections and may evolve.
|
||||
|
||||
| English / Context | Preferred | Notes |
|
||||
| ----------------------------------- | ------------ | ----------------------------- |
|
||||
| Save (data persistence action) | `Lagre` | Prefer over `Spare` |
|
||||
| Disabled (feature/state) | `deaktivert` | Prefer over `funksjonshemmet` |
|
||||
| API keys | `API Nøkler` | Prefer over `API Taster` |
|
||||
| Cost (noun) | `Kostnad` | Prefer over verb form `Koste` |
|
||||
| Show/View (imperative button label) | `Vis` | Prefer over `Utsikt` |
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural Norwegian Bokmal (Bokmål) wording over literal translation
|
||||
- Keep tone clear and practical in UI labels
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
- Keep recurring UI terms consistent once a preferred term is chosen
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid `Spare` for save actions in persistence contexts
|
||||
- Avoid `funksjonshemmet` for disabled feature states
|
||||
- Avoid `API Taster`, `Koste`, and `Utsikt` in the corrected contexts above
|
||||
@@ -1,27 +0,0 @@
|
||||
# pl Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #9884: https://github.com/anomalyco/opencode/pull/9884
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Commands, flags, file paths, and code literals (keep exactly as written)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural Polish phrasing over literal translation
|
||||
- Keep tone clear and direct in UI labels and docs prose
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid translating product and protocol names that are fixed identifiers
|
||||
- Avoid mixing multiple Polish terms for the same recurring UI action once a preferred term is established
|
||||
@@ -1,27 +0,0 @@
|
||||
# ru Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #9882: https://github.com/anomalyco/opencode/pull/9882
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Commands, flags, file paths, and code literals (keep exactly as written)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural Russian phrasing over literal translation
|
||||
- Keep tone clear and direct in UI labels and docs prose
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid translating product and protocol names that are fixed identifiers
|
||||
- Avoid mixing multiple Russian terms for the same recurring UI action once a preferred term is established
|
||||
@@ -1,34 +0,0 @@
|
||||
# th Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #10809: https://github.com/anomalyco/opencode/pull/10809
|
||||
- PR #11496: https://github.com/anomalyco/opencode/pull/11496
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- Commands, flags, file paths, and code literals (keep exactly as written)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
These are PR-backed preferences and may evolve.
|
||||
|
||||
| English / Context | Preferred | Notes |
|
||||
| ------------------------------------- | --------------------- | -------------------------------------------------------------------------------- |
|
||||
| Thai language label in language lists | `ไทย` | PR #10809 standardized this across locales |
|
||||
| Language names in language pickers | Native names (static) | PR #11496: keep names like `English`, `Deutsch`, `ไทย` consistent across locales |
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural Thai phrasing over literal translation
|
||||
- Keep tone short and clear for buttons and labels
|
||||
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
|
||||
- Keep language names static/native in language pickers instead of translating them per current locale (PR #11496)
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid translating language names differently per current locale in language lists
|
||||
- Avoid changing `ไทย` to another display form for the Thai language option unless the product standard changes
|
||||
@@ -1,42 +0,0 @@
|
||||
# zh-cn Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #13942: https://github.com/anomalyco/opencode/pull/13942
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only when it is part of commands, package names, paths, or code)
|
||||
- `OpenCode Zen`
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- `Model Context Protocol` (prefer the English expansion when introducing `MCP`)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
These are preferred terms for docs/UI prose and may evolve.
|
||||
|
||||
| English | Preferred | Notes |
|
||||
| ----------------------- | --------- | ------------------------------------------- |
|
||||
| prompt | 提示词 | Keep `--prompt` unchanged in flags/code |
|
||||
| session | 会话 | |
|
||||
| provider | 提供商 | |
|
||||
| share link / shared URL | 分享链接 | Prefer `分享` for user-facing share actions |
|
||||
| headless (server) | 无界面 | Docs wording |
|
||||
| authentication | 认证 | Prefer in auth/OAuth contexts |
|
||||
| cache | 缓存 | |
|
||||
| keybind / shortcut | 快捷键 | User-facing docs wording |
|
||||
| workflow | 工作流 | e.g. GitHub Actions workflow |
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural, concise phrasing over literal translation
|
||||
- Keep the tone direct and friendly (PR #13942 consistently moved wording in this direction)
|
||||
- Preserve technical artifacts exactly: commands, flags, code, inline code, URLs, file paths, model IDs
|
||||
- Keep enum-like values in English when they are literals (for example, `default`, `json`)
|
||||
- Prefer consistent terminology across pages once a term is chosen (`会话`, `提供商`, `提示词`, etc.)
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid `opencode` in prose when referring to the product name; use `OpenCode`
|
||||
- Avoid mixing alternative terms for the same concept across docs when a preferred term is already established
|
||||
@@ -1,42 +0,0 @@
|
||||
# zh-tw Glossary
|
||||
|
||||
## Sources
|
||||
|
||||
- PR #13942: https://github.com/anomalyco/opencode/pull/13942
|
||||
|
||||
## Do Not Translate (Locale Additions)
|
||||
|
||||
- `OpenCode` (preserve casing in prose; keep `opencode` only when it is part of commands, package names, paths, or code)
|
||||
- `OpenCode Zen`
|
||||
- `OpenCode CLI`
|
||||
- `CLI`, `TUI`, `MCP`, `OAuth`
|
||||
- `Model Context Protocol` (prefer the English expansion when introducing `MCP`)
|
||||
|
||||
## Preferred Terms
|
||||
|
||||
These are preferred terms for docs/UI prose and may evolve.
|
||||
|
||||
| English | Preferred | Notes |
|
||||
| ----------------------- | --------- | ------------------------------------------- |
|
||||
| prompt | 提示詞 | Keep `--prompt` unchanged in flags/code |
|
||||
| session | 工作階段 | |
|
||||
| provider | 供應商 | |
|
||||
| share link / shared URL | 分享連結 | Prefer `分享` for user-facing share actions |
|
||||
| headless (server) | 無介面 | Docs wording |
|
||||
| authentication | 認證 | Prefer in auth/OAuth contexts |
|
||||
| cache | 快取 | |
|
||||
| keybind / shortcut | 快捷鍵 | User-facing docs wording |
|
||||
| workflow | 工作流程 | e.g. GitHub Actions workflow |
|
||||
|
||||
## Guidance
|
||||
|
||||
- Prefer natural, concise phrasing over literal translation
|
||||
- Keep the tone direct and friendly (PR #13942 consistently moved wording in this direction)
|
||||
- Preserve technical artifacts exactly: commands, flags, code, inline code, URLs, file paths, model IDs
|
||||
- Keep enum-like values in English when they are literals (for example, `default`, `json`)
|
||||
- Prefer consistent terminology across pages once a term is chosen (`工作階段`, `供應商`, `提示詞`, etc.)
|
||||
|
||||
## Avoid
|
||||
|
||||
- Avoid `opencode` in prose when referring to the product name; use `OpenCode`
|
||||
- Avoid mixing alternative terms for the same concept across docs when a preferred term is already established
|
||||
@@ -13,25 +13,10 @@ Requirements:
|
||||
- Preserve meaning, intent, tone, and formatting (including Markdown/MDX structure).
|
||||
- Preserve all technical terms and artifacts exactly: product/company names, API names, identifiers, code, commands/flags, file paths, URLs, versions, error messages, config keys/values, and anything inside inline code or code blocks.
|
||||
- Also preserve every term listed in the Do-Not-Translate glossary below.
|
||||
- Also apply locale-specific guidance from `.opencode/agent/glossary/<locale>.md` when available (for example, `zh-cn.md`).
|
||||
- Do not modify fenced code blocks.
|
||||
- Output ONLY the translation (no commentary).
|
||||
|
||||
If the target locale is missing, ask the user to provide it.
|
||||
If no locale-specific glossary exists, use the global glossary only.
|
||||
|
||||
---
|
||||
|
||||
# Locale-Specific Glossaries
|
||||
|
||||
When a locale glossary exists, use it to:
|
||||
|
||||
- Apply preferred wording for recurring UI/docs terms in that locale
|
||||
- Preserve locale-specific do-not-translate terms and casing decisions
|
||||
- Prefer natural phrasing over literal translation when the locale file calls it out
|
||||
- If the repo uses a locale alias slug, apply that file too (for example, `pt-BR` maps to `br.md` in this repo)
|
||||
|
||||
Locale guidance does not override code/command preservation rules or the global Do-Not-Translate glossary below.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
Here's the process I've been using to create icons:
|
||||
|
||||
- Save source image as `app-icon.png` in `packages/desktop`
|
||||
- `cd` to `packages/desktop`
|
||||
- Run `bun tauri icon -o src-tauri/icons/{environment}`
|
||||
- `cd` to `src-tauri`
|
||||
- Run `bun tauri icons -o icons/{environment}`
|
||||
- Use [Image2Icon](https://img2icnsapp.com/)'s 'Big Sur Icon' preset to generate an `icon.icns` file and place it in the appropriate icons folder
|
||||
|
||||
The Image2Icon step is necessary as the `icon.icns` generated by `app-icon.png` does not apply the shadow/padding expected by macOS,
|
||||
|
||||
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
</adaptive-icon>
|
||||
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#fff</color>
|
||||
</resources>
|
||||
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 168 KiB |
|
Before Width: | Height: | Size: 687 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 582 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB |
@@ -4,18 +4,6 @@
|
||||
"identifier": "ai.opencode.desktop.beta",
|
||||
"bundle": {
|
||||
"createUpdaterArtifacts": true,
|
||||
"icon": [
|
||||
"icons/beta/32x32.png",
|
||||
"icons/beta/128x128.png",
|
||||
"icons/beta/128x128@2x.png",
|
||||
"icons/beta/icon.icns",
|
||||
"icons/beta/icon.ico"
|
||||
],
|
||||
"windows": {
|
||||
"nsis": {
|
||||
"installerIcon": "icons/beta/icon.ico"
|
||||
}
|
||||
},
|
||||
"linux": {
|
||||
"rpm": {
|
||||
"compression": {
|
||||
|
||||
@@ -1101,6 +1101,7 @@ export function Session() {
|
||||
</Match>
|
||||
<Match when={message.role === "assistant"}>
|
||||
<AssistantMessage
|
||||
index={index()}
|
||||
last={lastAssistant()?.id === message.id}
|
||||
message={message as AssistantMessage}
|
||||
parts={sync.data.part[message.id] ?? []}
|
||||
@@ -1269,7 +1270,7 @@ function UserMessage(props: {
|
||||
)
|
||||
}
|
||||
|
||||
function AssistantMessage(props: { message: AssistantMessage; parts: Part[]; last: boolean }) {
|
||||
function AssistantMessage(props: { index: number; message: AssistantMessage; parts: Part[]; last: boolean }) {
|
||||
const local = useLocal()
|
||||
const { theme } = useTheme()
|
||||
const sync = useSync()
|
||||
@@ -1279,12 +1280,32 @@ function AssistantMessage(props: { message: AssistantMessage; parts: Part[]; las
|
||||
return props.message.finish && !["tool-calls", "unknown"].includes(props.message.finish)
|
||||
})
|
||||
|
||||
const duration = createMemo(() => {
|
||||
if (!final()) return 0
|
||||
if (!props.message.time.completed) return 0
|
||||
const user = messages().find((x) => x.role === "user" && x.id === props.message.parentID)
|
||||
if (!user || !user.time) return 0
|
||||
return props.message.time.completed - user.time.created
|
||||
const stats = createMemo(() => {
|
||||
if (!final() || !props.message.time.completed) return null
|
||||
|
||||
const list = messages()
|
||||
let tokens = 0
|
||||
let active = 0
|
||||
|
||||
for (let i = props.index; i >= 0; i--) {
|
||||
const msg = list[i]
|
||||
if (msg.role === "assistant") {
|
||||
tokens += msg.tokens?.output || 0
|
||||
if (msg.time.started && msg.time.streamed) {
|
||||
const delta = msg.time.streamed - msg.time.started
|
||||
if (delta > 0) active += delta
|
||||
}
|
||||
}
|
||||
if (msg.role === "user" && msg.id === props.message.parentID) {
|
||||
if (!msg.time?.created) return null
|
||||
const total = props.message.time.completed - msg.time.created
|
||||
if (total <= 0 || active <= 0) return null
|
||||
const tps = tokens > 0 ? tokens / (active / 1000) : null
|
||||
return { total, tps }
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
})
|
||||
|
||||
return (
|
||||
@@ -1334,8 +1355,14 @@ function AssistantMessage(props: { message: AssistantMessage; parts: Part[]; las
|
||||
</span>{" "}
|
||||
<span style={{ fg: theme.text }}>{Locale.titlecase(props.message.mode)}</span>
|
||||
<span style={{ fg: theme.textMuted }}> · {props.message.modelID}</span>
|
||||
<Show when={duration()}>
|
||||
<span style={{ fg: theme.textMuted }}> · {Locale.duration(duration())}</span>
|
||||
<Show when={stats()}>
|
||||
{(s) => (
|
||||
<span style={{ fg: theme.textMuted }}>
|
||||
{" "}
|
||||
· {Locale.duration(s().total)}
|
||||
<Show when={s().tps !== null}> · {s().tps!.toFixed(1)} tok/s</Show>
|
||||
</span>
|
||||
)}
|
||||
</Show>
|
||||
<Show when={props.message.error?.name === "MessageAbortedError"}>
|
||||
<span style={{ fg: theme.textMuted }}> · interrupted</span>
|
||||
|
||||
@@ -392,7 +392,9 @@ export namespace MessageV2 {
|
||||
role: z.literal("assistant"),
|
||||
time: z.object({
|
||||
created: z.number(),
|
||||
started: z.number().optional(),
|
||||
completed: z.number().optional(),
|
||||
streamed: z.number().optional(),
|
||||
}),
|
||||
error: z
|
||||
.discriminatedUnion("name", [
|
||||
|
||||
@@ -137,7 +137,9 @@ export namespace Message {
|
||||
.object({
|
||||
time: z.object({
|
||||
created: z.number(),
|
||||
started: z.number().optional(),
|
||||
completed: z.number().optional(),
|
||||
streamed: z.number().optional(),
|
||||
}),
|
||||
error: z
|
||||
.discriminatedUnion("name", [AuthError.Schema, NamedError.Unknown.Schema, OutputLengthError.Schema])
|
||||
|
||||
@@ -57,6 +57,10 @@ export namespace SessionProcessor {
|
||||
switch (value.type) {
|
||||
case "start":
|
||||
SessionStatus.set(input.sessionID, { type: "busy" })
|
||||
if (!input.assistantMessage.time.started) {
|
||||
input.assistantMessage.time.started = Date.now()
|
||||
await Session.updateMessage(input.assistantMessage)
|
||||
}
|
||||
break
|
||||
|
||||
case "reasoning-start":
|
||||
@@ -337,6 +341,10 @@ export namespace SessionProcessor {
|
||||
break
|
||||
|
||||
case "finish":
|
||||
if (!input.assistantMessage.time.streamed) {
|
||||
input.assistantMessage.time.streamed = Date.now()
|
||||
await Session.updateMessage(input.assistantMessage)
|
||||
}
|
||||
break
|
||||
|
||||
default:
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
---
|
||||
title: GitLab
|
||||
description: GitLab 이슈와 merge request에서 OpenCode를 사용하세요.
|
||||
description: GitLab 이슈 및 머지 리퀘스트에서 opencode를 사용하세요.
|
||||
---
|
||||
|
||||
OpenCode는 GitLab CI/CD 파이프라인 또는 GitLab Duo를 통해 GitLab 워크플로에 통합됩니다.
|
||||
opencode는 GitLab CI/CD 파이프라인 또는 GitLab Duo를 통해 GitLab 워크플로우와 통합됩니다.
|
||||
|
||||
두 경우 모두 OpenCode는 GitLab runner에서 실행됩니다.
|
||||
두 경우, opencode는 GitLab runners에서 실행됩니다.
|
||||
|
||||
---
|
||||
|
||||
## GitLab CI
|
||||
# GitLab CI 소개
|
||||
|
||||
OpenCode는 일반 GitLab 파이프라인에서 작동합니다. [CI component](https://docs.gitlab.com/ee/ci/components/)로 파이프라인에 통합할 수 있습니다.
|
||||
opencode는 일반 GitLab 파이프라인에서 작동합니다. [CI 컴포넌트](https://docs.gitlab.com/ee/ci/components/)로 파이프라인에 구축할 수 있습니다.
|
||||
|
||||
여기서는 OpenCode용 커뮤니티 제작 CI/CD component인 [nagyv/gitlab-opencode](https://gitlab.com/nagyv/gitlab-opencode)를 사용합니다.
|
||||
여기에서 우리는 opencode에 대한 커뮤니티 생성 CI / CD 구성품을 사용하고 있습니다. [nagyv/gitlab-opencode](https://gitlab.com/nagyv/gitlab-opencode).
|
||||
|
||||
---
|
||||
|
||||
### 기능
|
||||
|
||||
- **job별 custom config 사용**: custom config 디렉터리(예: `./config/#custom-directory`)를 사용해 OpenCode를 각 실행 단위로 설정하고 기능을 켜거나 끌 수 있습니다.
|
||||
- **최소 설정**: CI component가 백그라운드에서 OpenCode를 설정하므로 OpenCode config와 초기 prompt만 만들면 됩니다.
|
||||
- **유연함**: CI component는 동작을 사용자화할 수 있도록 여러 입력값을 지원합니다.
|
||||
- **실행별 사용자 지정 구성 사용**: 사용자 정의 구성 디렉토리와 opencode 구성, 예를 들어 `./config/#custom-directory`는 opencode 실행마다 활성화하거나 비활성화 할 수 있습니다.
|
||||
- ** 최소 설정**: CI 구성 요소는 opencode를 배경으로 설정하면 opencode 구성과 초기 프롬프트를 만들 필요가 있습니다.
|
||||
- **Flexible**: CI 구성 요소는 여러 입력을 지원합니다.
|
||||
|
||||
---
|
||||
|
||||
### Setup
|
||||
## 설정
|
||||
|
||||
1. OpenCode 인증 JSON을 **Settings** > **CI/CD** > **Variables** 아래의 File 타입 CI 환경 변수로 저장하세요. 반드시 "Masked and hidden"으로 표시하세요.
|
||||
2. 아래 내용을 `.gitlab-ci.yml` 파일에 추가하세요.
|
||||
1. opencode 인증 JSON을 **Settings** > **CI/CD** > **Variables**에서 파일 유형 CI 환경 변수로 저장하십시오. "Masked and hidden"로 표시하십시오.
|
||||
2. `.gitlab-ci.yml` 파일에 뒤에 추가하십시오.
|
||||
|
||||
```yaml title=".gitlab-ci.yml"
|
||||
include:
|
||||
@@ -40,40 +40,40 @@ OpenCode는 일반 GitLab 파이프라인에서 작동합니다. [CI component](
|
||||
message: "Your prompt here"
|
||||
```
|
||||
|
||||
더 많은 입력값과 사용 사례는 이 component의 [docs](https://gitlab.com/explore/catalog/nagyv/gitlab-opencode)에서 확인하세요.
|
||||
더 많은 입력 및 사용 사례 [docs를 체크 아웃](https://gitlab.com/explore/catalog/nagyv/gitlab-opencode) 이 구성 요소에 대한.
|
||||
|
||||
---
|
||||
|
||||
## GitLab Duo
|
||||
|
||||
OpenCode는 GitLab 워크플로에 통합됩니다.
|
||||
댓글에서 `@opencode`를 멘션하면 OpenCode가 GitLab CI 파이프라인 안에서 작업을 실행합니다.
|
||||
opencode는 GitLab 워크플로우와 통합됩니다.
|
||||
코멘트에 Mention `@opencode`, opencode는 GitLab CI 파이프라인 내에서 작업을 실행합니다.
|
||||
|
||||
---
|
||||
|
||||
### 기능
|
||||
|
||||
- **이슈 분류**: OpenCode에 이슈를 살펴보고 설명해 달라고 요청할 수 있습니다.
|
||||
- **수정 및 구현**: OpenCode에 이슈를 수정하거나 기능을 구현해 달라고 요청할 수 있습니다.
|
||||
OpenCode는 새 브랜치를 만들고 변경 사항이 담긴 merge request를 생성합니다.
|
||||
- **보안**: OpenCode는 GitLab runner에서 실행됩니다.
|
||||
- **이슈**: opencode가 문제점을 보고 당신을 설명합니다.
|
||||
- **수정 및 구현**: 이슈를 수정하거나 기능을 구현하려면 opencode에 문의하십시오.
|
||||
새로운 지점을 만들고 변화를 병합 요청을 제기합니다.
|
||||
- **보안**: opencode는 GitLab runners에서 실행됩니다.
|
||||
|
||||
---
|
||||
|
||||
### Setup
|
||||
## 설정
|
||||
|
||||
OpenCode는 GitLab CI/CD 파이프라인에서 실행되며, 설정에 필요한 항목은 다음과 같습니다.
|
||||
opencode는 GitLab CI/CD 파이프라인에서 실행되며, 여기서 설정해야 할 일은 다음과 같습니다.
|
||||
|
||||
:::tip
|
||||
[최신 안내는 **GitLab docs**](https://docs.gitlab.com/user/duo_agent_platform/agent_assistant/)를 확인하세요.
|
||||
[**GitLab docs**](https://docs.gitlab.com/user/duo agent platform/agent assistant/) 를 체크 아웃하십시오.
|
||||
:::
|
||||
|
||||
1. GitLab 환경을 설정합니다.
|
||||
2. CI/CD를 설정합니다.
|
||||
3. AI model provider API 키를 준비합니다.
|
||||
4. 서비스 계정을 생성합니다.
|
||||
5. CI/CD 변수를 설정합니다.
|
||||
6. flow config 파일을 생성합니다. 예시는 다음과 같습니다.
|
||||
1. GitLab 환경 설정
|
||||
2. CI/CD 설치
|
||||
3. AI 모형 공급자 API 열쇠를 얻으십시오
|
||||
4. 서비스 계정 만들기
|
||||
5. CI/CD 변수 구성
|
||||
6. Flow config 파일을 만들려면 다음과 같습니다.
|
||||
|
||||
<details>
|
||||
|
||||
@@ -152,44 +152,44 @@ OpenCode는 GitLab CI/CD 파이프라인에서 실행되며, 설정에 필요한
|
||||
|
||||
</details>
|
||||
|
||||
[GitLab CLI agents docs](https://docs.gitlab.com/user/duo_agent_platform/agent_assistant/)에서 자세한 안내를 확인할 수 있습니다.
|
||||
자세한 지침에 대한 [GitLab CLI Agent docs](https://docs.gitlab.com/user/duo agent platform/agent assistant/)를 참조할 수 있습니다.
|
||||
|
||||
---
|
||||
|
||||
### 예제
|
||||
|
||||
다음은 GitLab에서 OpenCode를 사용하는 몇 가지 예시입니다.
|
||||
다음은 GitLab에서 opencode를 사용할 수있는 몇 가지 예입니다.
|
||||
|
||||
:::tip
|
||||
`@opencode` 대신 다른 trigger phrase를 사용하도록 설정할 수 있습니다.
|
||||
`@opencode`보다 다른 트리거 구문을 사용할 수 있습니다.
|
||||
:::
|
||||
|
||||
- **이슈 설명**
|
||||
|
||||
GitLab 이슈에 아래 댓글을 남기세요.
|
||||
GitLab 문제에서이 코멘트를 추가하십시오.
|
||||
|
||||
```
|
||||
@opencode explain this issue
|
||||
```
|
||||
|
||||
OpenCode가 이슈를 읽고 명확한 설명으로 답변합니다.
|
||||
opencode는 문제와 대답을 명확하게 설명합니다.
|
||||
|
||||
- **이슈 해결**
|
||||
|
||||
GitLab 이슈에서 다음과 같이 요청하세요.
|
||||
GitLab 문제에서, 말한다:
|
||||
|
||||
```
|
||||
@opencode fix this
|
||||
```
|
||||
|
||||
OpenCode가 새 브랜치를 만들고 변경 사항을 구현한 뒤, 해당 변경 사항으로 merge request를 엽니다.
|
||||
opencode는 새로운 지점을 만들 것이며 변경 사항을 구현하고 변경 사항을 병합 요청을 엽니다.
|
||||
|
||||
- **머지 리퀘스트 검토**
|
||||
|
||||
GitLab merge request에 아래 댓글을 남기세요.
|
||||
GitLab 병합 요청에 대한 다음 의견을 남겨주세요.
|
||||
|
||||
```
|
||||
@opencode review this merge request
|
||||
```
|
||||
|
||||
OpenCode가 merge request를 검토하고 피드백을 제공합니다.
|
||||
opencode는 병합 요청을 검토하고 피드백을 제공합니다.
|
||||
|
||||
@@ -1,36 +1,35 @@
|
||||
---
|
||||
title: IDE
|
||||
description: VS Code, Cursor 및 기타 IDE용 OpenCode 확장 프로그램
|
||||
description: VS Code, Cursor 및 기타 IDE용 opencode 확장 프로그램.
|
||||
---
|
||||
|
||||
OpenCode는 VS Code, Cursor, 또는 터미널을 지원하는 모든 IDE와 통합됩니다. 시작하려면 터미널에서 `opencode`를 실행하세요.
|
||||
opencode는 VS Code, Cursor, 또는 터미널을 지원하는 IDE와 통합됩니다. 시작하려면 terminal에서 `opencode`를 실행하십시오.
|
||||
|
||||
---
|
||||
|
||||
## 사용법
|
||||
|
||||
- **Quick Launch**: `Cmd+Esc` (Mac) 또는 `Ctrl+Esc` (Windows/Linux)를 사용해 분할 터미널 뷰에서 OpenCode를 열거나, 이미 실행 중인 터미널 세션으로 포커스하세요.
|
||||
- **New Session**: `Cmd+Shift+Esc` (Mac) 또는 `Ctrl+Shift+Esc` (Windows/Linux)를 사용해 기존 세션이 열려 있어도 새 OpenCode 터미널 세션을 시작하세요. UI의 OpenCode 버튼을 클릭해도 됩니다.
|
||||
- **Context Awareness**: 현재 선택 영역이나 탭을 OpenCode와 자동으로 공유합니다.
|
||||
- **File Reference Shortcuts**: `Cmd+Option+K` (Mac) 또는 `Alt+Ctrl+K` (Linux/Windows)를 사용해 파일 참조를 삽입하세요. 예: `@File#L37-42`.
|
||||
-**Quick Launch**: `Cmd+Esc` (Mac) 또는 `Ctrl+Esc` (Windows/Linux)를 사용하여 통합 터미널 뷰에 opencode를 열거나 기존 terminal 세션을 이미 실행하면 됩니다. -**New Session**: `Cmd+Shift+Esc` (Mac) 또는 `Ctrl+Shift+Esc` (Windows/Linux)를 사용하여 새로운 opencode terminal 세션을 시작하려면 이미 열리면 됩니다. UI에서 opencode 버튼을 클릭합니다. -**Context Awareness**: opencode로 현재 선택 또는 탭을 자동으로 공유합니다.
|
||||
|
||||
- **파일 참조 단축키** : 파일 참조를 삽입하려면 `Cmd+Option+K` (Mac) 또는 `Alt+Ctrl+K` (Linux / Windows)를 사용하십시오. 예를 들어, `@File#L37-42`.
|
||||
|
||||
---
|
||||
|
||||
## 설치
|
||||
|
||||
VS Code와 Cursor, Windsurf, VSCodium 같은 인기 포크에 OpenCode를 설치하려면:
|
||||
VS Code에 opencode를 설치하고 Cursor, Windsurf, VSCodium과 같은 인기있는 포크 :
|
||||
|
||||
1. VS Code를 여세요.4
|
||||
2. 통합 터미널을 여세요.
|
||||
3. `opencode`를 실행하세요. 확장 프로그램이 자동으로 설치됩니다.
|
||||
1. VS Code 열기
|
||||
2. 통합 terminal을 여십시오
|
||||
3. 실행 `opencode` - 확장 자동으로 설치
|
||||
|
||||
반면 TUI에서 `/editor` 또는 `/export`를 실행할 때 자체 IDE를 사용하려면 `export EDITOR="code --wait"`를 설정해야 합니다. [자세히 알아보기](/docs/tui/#editor-setup).
|
||||
반면에 TUI에서 `/editor` 또는 `/export`를 실행할 때, 당신은 `export EDITOR="code --wait"`를 설정할 필요가 있을 것입니다. [Learn more](/docs/tui/#editor-setup).
|
||||
|
||||
---
|
||||
|
||||
### 수동 설치
|
||||
## 수동 설치
|
||||
|
||||
Extension Marketplace에서 **OpenCode**를 검색한 다음 **Install**을 클릭하세요.
|
||||
확장 마켓 플레이스에서 **opencode**를 검색하고 **Install**를 클릭합니다.
|
||||
|
||||
---
|
||||
|
||||
@@ -38,11 +37,11 @@ Extension Marketplace에서 **OpenCode**를 검색한 다음 **Install**을 클
|
||||
|
||||
확장이 자동으로 설치되지 않는 경우:
|
||||
|
||||
- 통합 터미널에서 `opencode`를 실행하고 있는지 확인하세요.
|
||||
- IDE용 CLI가 설치되어 있는지 확인하세요.
|
||||
- VS Code: `code` command
|
||||
- Cursor: `cursor` command
|
||||
- Windsurf: `windsurf` command
|
||||
- VSCodium: `codium` command
|
||||
- 설치되어 있지 않다면 `Cmd+Shift+P` (Mac) 또는 `Ctrl+Shift+P` (Windows/Linux)를 실행하고 "Shell Command: Install 'code' command in PATH"(또는 IDE에 맞는 동등한 명령)를 검색하세요.
|
||||
- VS Code에 확장 프로그램 설치 권한이 있는지 확인하세요.
|
||||
- 통합 terminal에서 `opencode`를 실행하는 것을 보장합니다.
|
||||
- IDE용 CLI가 설치됩니다.
|
||||
- VS Code : `code` 명령
|
||||
- 커서: `cursor` 명령
|
||||
- 윈드 서핑을 위해: `windsurf` 명령
|
||||
- VSCodium의 경우: `codium` 명령
|
||||
- 만약 `Cmd+Shift+P` (Mac) 또는 `Ctrl+Shift+P` (Windows/Linux)를 실행하고 "Shell Command: PATH"에서 'code' 명령을 설치하십시오 (또는 IDE에 해당)
|
||||
- Ensure VS Code는 확장을 설치하는 권한이 있습니다.
|
||||
|
||||
@@ -7,19 +7,19 @@ import { Tabs, TabItem } from "@astrojs/starlight/components"
|
||||
import config from "../../../../config.mjs"
|
||||
export const console = config.console
|
||||
|
||||
[**OpenCode**](/)는 오픈 소스 AI coding agent입니다. 터미널 기반 인터페이스, 데스크톱 앱, IDE 확장으로 사용할 수 있습니다.
|
||||
[**OpenCode**](/)는 터미널 기반 인터페이스, 데스크톱 앱, IDE 확장 형태로 사용할 수 있는 오픈 소스 AI 코딩 에이전트입니다.
|
||||
|
||||

|
||||
|
||||
바로 시작해 보겠습니다.
|
||||
바로 시작해 봅시다.
|
||||
|
||||
---
|
||||
|
||||
#### 사전 준비
|
||||
## 사전 준비
|
||||
|
||||
터미널에서 OpenCode를 사용하려면 다음이 필요합니다.
|
||||
|
||||
1. 다음과 같은 최신 터미널 에뮬레이터
|
||||
1. 최신 터미널 에뮬레이터 (예:)
|
||||
- [WezTerm](https://wezterm.org), 크로스 플랫폼
|
||||
- [Alacritty](https://alacritty.org), 크로스 플랫폼
|
||||
- [Ghostty](https://ghostty.org), Linux 및 macOS
|
||||
@@ -31,13 +31,13 @@ export const console = config.console
|
||||
|
||||
## 설치
|
||||
|
||||
OpenCode를 설치하는 가장 쉬운 방법은 설치 스크립트를 사용하는 것입니다.
|
||||
가장 쉬운 설치 방법은 설치 스크립트를 사용하는 것입니다.
|
||||
|
||||
```bash
|
||||
curl -fsSL https://opencode.ai/install | bash
|
||||
```
|
||||
|
||||
다음 명령으로도 설치할 수 있습니다.
|
||||
아래 명령으로도 설치할 수 있습니다.
|
||||
|
||||
- **Node.js 사용**
|
||||
|
||||
@@ -79,9 +79,9 @@ curl -fsSL https://opencode.ai/install | bash
|
||||
brew install anomalyco/tap/opencode
|
||||
```
|
||||
|
||||
> 최신 릴리스를 사용하려면 OpenCode tap 사용을 권장합니다. 공식 `brew install opencode` formula는 Homebrew 팀이 관리하며 업데이트 주기가 더 깁니다.
|
||||
> 최신 릴리스는 OpenCode tap 사용을 권장합니다. 공식 `brew install opencode` 포뮬러는 Homebrew 팀이 관리하므로 업데이트 주기가 더 긴 편입니다.
|
||||
|
||||
- **Arch Linux에 설치**
|
||||
- **Arch Linux에서 Paru 사용**
|
||||
|
||||
```bash
|
||||
sudo pacman -S opencode # Arch Linux (Stable)
|
||||
@@ -91,7 +91,7 @@ curl -fsSL https://opencode.ai/install | bash
|
||||
#### Windows
|
||||
|
||||
:::tip[권장: WSL 사용]
|
||||
Windows에서는 [Windows Subsystem for Linux (WSL)](/docs/windows-wsl) 사용을 권장합니다. 성능이 더 좋고 OpenCode 기능과의 완전한 호환성을 제공합니다.
|
||||
Windows에서는 [Windows Subsystem for Linux (WSL)](/docs/windows-wsl)을 사용하는 것이 가장 좋습니다. OpenCode 기능과의 호환성이 높고 성능도 더 좋습니다.
|
||||
:::
|
||||
|
||||
- **Chocolatey 사용**
|
||||
@@ -124,7 +124,7 @@ Windows에서는 [Windows Subsystem for Linux (WSL)](/docs/windows-wsl) 사용
|
||||
docker run -it --rm ghcr.io/anomalyco/opencode
|
||||
```
|
||||
|
||||
현재 Windows에서 Bun을 사용한 OpenCode 설치 지원은 준비 중입니다.
|
||||
Windows에서 Bun을 통한 OpenCode 설치는 아직 지원되지 않으며, 현재 지원을 준비 중입니다.
|
||||
|
||||
[Releases](https://github.com/anomalyco/opencode/releases)에서 바이너리를 직접 받아 설치할 수도 있습니다.
|
||||
|
||||
@@ -134,16 +134,16 @@ Windows에서는 [Windows Subsystem for Linux (WSL)](/docs/windows-wsl) 사용
|
||||
|
||||
OpenCode는 API 키를 설정하면 원하는 LLM 제공자를 사용할 수 있습니다.
|
||||
|
||||
LLM 제공자를 처음 사용한다면 [OpenCode Zen](/docs/zen) 사용을 권장합니다.
|
||||
LLM 제공자(LLM Provider)를 처음 사용한다면 [OpenCode Zen](/docs/zen)을 추천합니다.
|
||||
OpenCode 팀이 테스트하고 검증한 모델 목록입니다.
|
||||
|
||||
1. TUI에서 `/connect` 명령을 실행하고 `opencode`를 선택한 다음 [opencode.ai/auth](https://opencode.ai/auth)로 이동합니다.
|
||||
1. TUI에서 `/connect` 명령을 실행한 뒤 `opencode`를 선택하고 [opencode.ai/auth](https://opencode.ai/auth)로 이동합니다.
|
||||
|
||||
```txt
|
||||
/connect
|
||||
```
|
||||
|
||||
2. 로그인하고 결제 정보를 추가한 뒤 API 키를 복사합니다.
|
||||
2. 로그인 후 결제 정보를 입력하고 API 키를 복사합니다.
|
||||
|
||||
3. API 키를 붙여 넣습니다.
|
||||
|
||||
@@ -154,13 +154,13 @@ OpenCode 팀이 테스트하고 검증한 모델 목록입니다.
|
||||
└ enter
|
||||
```
|
||||
|
||||
또는 다른 제공자 중 하나를 선택할 수도 있습니다. [더 알아보기](/docs/providers#directory).
|
||||
다른 제공자를 선택해도 됩니다. [더 알아보기](/docs/providers#directory).
|
||||
|
||||
---
|
||||
|
||||
## 초기화
|
||||
|
||||
이제 제공자 구성을 마쳤으니 작업하려는 프로젝트로 이동합니다.
|
||||
이제 제공자 구성이 끝났으니, 작업할 프로젝트 디렉터리로 이동합니다.
|
||||
|
||||
```bash
|
||||
cd /path/to/project
|
||||
@@ -172,19 +172,19 @@ cd /path/to/project
|
||||
opencode
|
||||
```
|
||||
|
||||
다음 명령을 실행해 프로젝트에서 OpenCode를 초기화합니다.
|
||||
다음 명령으로 프로젝트용 OpenCode 초기화를 진행합니다.
|
||||
|
||||
```bash frame="none"
|
||||
/init
|
||||
```
|
||||
|
||||
이 명령을 실행하면 OpenCode가 프로젝트를 분석하고 프로젝트 루트에 `AGENTS.md` 파일을 생성합니다.
|
||||
이 명령은 프로젝트를 분석하고 루트에 `AGENTS.md` 파일을 생성합니다.
|
||||
|
||||
:::tip
|
||||
프로젝트의 `AGENTS.md` 파일은 Git에 커밋하는 것을 권장합니다.
|
||||
프로젝트의 `AGENTS.md`는 Git에 커밋해 두는 것을 권장합니다.
|
||||
:::
|
||||
|
||||
이렇게 하면 OpenCode가 프로젝트 구조와 사용 중인 코딩 패턴을 더 잘 이해할 수 있습니다.
|
||||
그러면 OpenCode가 프로젝트 구조와 코딩 패턴을 더 잘 이해할 수 있습니다.
|
||||
|
||||
---
|
||||
|
||||
@@ -192,7 +192,7 @@ opencode
|
||||
|
||||
이제 OpenCode로 프로젝트 작업을 시작할 준비가 되었습니다. 무엇이든 물어보세요.
|
||||
|
||||
AI coding agent를 처음 사용한다면 도움이 될 수 있는 예시를 소개합니다.
|
||||
AI 코딩 에이전트를 처음 쓰는 경우 도움이 되는 예시를 소개합니다.
|
||||
|
||||
---
|
||||
|
||||
@@ -208,25 +208,25 @@ OpenCode에 코드베이스 설명을 요청할 수 있습니다.
|
||||
How is authentication handled in @packages/functions/src/api/index.ts
|
||||
```
|
||||
|
||||
이 방법은 직접 작업하지 않은 코드 영역을 이해할 때 유용합니다.
|
||||
직접 작업하지 않은 코드 영역을 이해할 때 특히 유용합니다.
|
||||
|
||||
---
|
||||
|
||||
### 기능 추가
|
||||
|
||||
OpenCode에 프로젝트의 새 기능 추가를 요청할 수 있습니다. 다만 먼저 계획을 만들도록 요청하는 것을 권장합니다.
|
||||
프로젝트에 새 기능을 추가해 달라고 요청할 수 있습니다. 다만 먼저 계획을 만들게 하는 것을 권장합니다.
|
||||
|
||||
1. **계획 만들기**
|
||||
|
||||
OpenCode에는 변경 작업 기능을 비활성화하고 기능을 구현할 방법만 제안하는 *Plan mode*가 있습니다.
|
||||
OpenCode에는 변경 작업을 비활성화하고 구현 방법을 제안만 하는 *Plan mode*가 있습니다.
|
||||
|
||||
**Tab** 키를 눌러 전환하세요. 화면 오른쪽 아래에서 모드 표시를 확인할 수 있습니다.
|
||||
**Tab** 키로 전환하면 오른쪽 아래에 모드 표시가 나타납니다.
|
||||
|
||||
```bash frame="none" title="Switch to Plan mode"
|
||||
<TAB>
|
||||
```
|
||||
|
||||
이제 수행하길 원하는 작업을 설명해 보겠습니다.
|
||||
이제 원하는 작업을 구체적으로 설명합니다.
|
||||
|
||||
```txt frame="none"
|
||||
When a user deletes a note, we'd like to flag it as deleted in the database.
|
||||
@@ -234,15 +234,15 @@ OpenCode에 프로젝트의 새 기능 추가를 요청할 수 있습니다. 다
|
||||
From this screen, the user can undelete a note or permanently delete it.
|
||||
```
|
||||
|
||||
OpenCode가 원하는 작업을 이해할 수 있도록 충분한 세부 정보를 제공해야 합니다. 팀의 주니어 개발자에게 말하듯이 설명하면 도움이 됩니다.
|
||||
OpenCode가 정확히 이해할 만큼 충분한 맥락을 주는 것이 중요합니다. 팀의 주니어 개발자에게 설명하듯 요청하면 도움이 됩니다.
|
||||
|
||||
:::tip
|
||||
OpenCode가 원하는 작업을 이해하도록 충분한 맥락과 예시를 제공하세요.
|
||||
맥락과 예시를 충분히 제공하면 원하는 결과를 얻기 쉽습니다.
|
||||
:::
|
||||
|
||||
2. **계획 다듬기**
|
||||
|
||||
계획이 나오면 피드백을 주거나 세부 사항을 더 추가할 수 있습니다.
|
||||
계획이 나오면 피드백을 주거나 추가 요구사항을 붙일 수 있습니다.
|
||||
|
||||
```txt frame="none"
|
||||
We'd like to design this new screen using a design I've used before.
|
||||
@@ -250,20 +250,20 @@ OpenCode에 프로젝트의 새 기능 추가를 요청할 수 있습니다. 다
|
||||
```
|
||||
|
||||
:::tip
|
||||
이미지를 터미널에 드래그 앤 드롭해 prompt에 추가하세요.
|
||||
이미지를 터미널에 드래그 앤 드롭하면 프롬프트에 첨부할 수 있습니다.
|
||||
:::
|
||||
|
||||
OpenCode는 제공한 이미지를 스캔해 prompt에 추가할 수 있습니다. 이미지를 터미널에 드래그 앤 드롭하면 됩니다.
|
||||
OpenCode는 첨부한 이미지를 분석해 프롬프트에 포함합니다.
|
||||
|
||||
3. **기능 구현**
|
||||
|
||||
계획이 충분히 마음에 들면 **Tab** 키를 다시 눌러 *Build mode*로 전환하세요.
|
||||
계획이 충분히 만족스러우면 **Tab** 키를 다시 눌러 *Build mode*로 돌아갑니다.
|
||||
|
||||
```bash frame="none"
|
||||
<TAB>
|
||||
```
|
||||
|
||||
그리고 변경을 적용해 달라고 요청하세요.
|
||||
그리고 실제 변경을 요청합니다.
|
||||
|
||||
```bash frame="none"
|
||||
Sounds good! Go ahead and make the changes.
|
||||
@@ -273,7 +273,7 @@ OpenCode에 프로젝트의 새 기능 추가를 요청할 수 있습니다. 다
|
||||
|
||||
### 바로 변경하기
|
||||
|
||||
비교적 간단한 변경은 계획을 먼저 검토하지 않고 바로 구현하도록 요청할 수 있습니다.
|
||||
비교적 단순한 변경은 계획 검토 없이 바로 구현하도록 요청해도 됩니다.
|
||||
|
||||
```txt frame="none" "@packages/functions/src/settings.ts" "@packages/functions/src/notes.ts"
|
||||
We need to add authentication to the /settings route. Take a look at how this is
|
||||
@@ -281,37 +281,37 @@ handled in the /notes route in @packages/functions/src/notes.ts and implement
|
||||
the same logic in @packages/functions/src/settings.ts
|
||||
```
|
||||
|
||||
OpenCode가 올바른 변경을 하도록 충분한 세부 정보를 제공해야 합니다.
|
||||
원하는 변경이 정확히 반영되도록, 필요한 맥락을 충분히 제공하세요.
|
||||
|
||||
---
|
||||
|
||||
### 변경 되돌리기
|
||||
|
||||
예를 들어 OpenCode에 변경을 요청했다고 해보겠습니다.
|
||||
예를 들어 OpenCode에 변경을 요청했다고 가정해 보겠습니다.
|
||||
|
||||
```txt frame="none" "@packages/functions/src/api/index.ts"
|
||||
Can you refactor the function in @packages/functions/src/api/index.ts?
|
||||
```
|
||||
|
||||
그런데 원하는 결과가 아니었다면 `/undo` 명령으로 변경을 **되돌릴 수** 있습니다.
|
||||
결과가 기대와 다르면 `/undo` 명령으로 **되돌릴 수** 있습니다.
|
||||
|
||||
```bash frame="none"
|
||||
/undo
|
||||
```
|
||||
|
||||
OpenCode가 방금 적용한 변경을 되돌리고 원래 메시지를 다시 보여줍니다.
|
||||
OpenCode는 방금 적용한 변경을 되돌리고 원래 메시지를 다시 보여줍니다.
|
||||
|
||||
```txt frame="none" "@packages/functions/src/api/index.ts"
|
||||
Can you refactor the function in @packages/functions/src/api/index.ts?
|
||||
```
|
||||
|
||||
여기에서 prompt를 수정해 다시 요청할 수 있습니다.
|
||||
이 상태에서 프롬프트를 다듬어 다시 시도하면 됩니다.
|
||||
|
||||
:::tip
|
||||
`/undo`는 여러 번 연속으로 실행할 수 있습니다.
|
||||
:::
|
||||
|
||||
또는 `/redo` 명령으로 변경을 **다시 적용**할 수 있습니다.
|
||||
반대로 `/redo` 명령으로 **다시 적용**할 수도 있습니다.
|
||||
|
||||
```bash frame="none"
|
||||
/redo
|
||||
@@ -327,18 +327,18 @@ OpenCode와의 대화는 [팀과 공유](/docs/share)할 수 있습니다.
|
||||
/share
|
||||
```
|
||||
|
||||
이 명령을 실행하면 현재 대화 링크를 생성하고 클립보드에 복사합니다.
|
||||
현재 대화 링크를 생성하고 클립보드에 복사합니다.
|
||||
|
||||
:::note
|
||||
대화는 기본값으로 공유되지 않습니다.
|
||||
:::
|
||||
|
||||
다음은 OpenCode [대화 예시](https://opencode.ai/s/4XP1fce5)입니다.
|
||||
아래는 OpenCode [대화 예시](https://opencode.ai/s/4XP1fce5)입니다.
|
||||
|
||||
---
|
||||
|
||||
## 사용자 지정
|
||||
|
||||
이제 OpenCode 사용법을 익혔습니다.
|
||||
이제 OpenCode 사용의 기본은 끝났습니다.
|
||||
|
||||
원하는 방식에 맞추려면 [테마 선택](/docs/themes), [키바인드 사용자 지정](/docs/keybinds), [코드 formatter 설정](/docs/formatters), [custom command 만들기](/docs/commands), [OpenCode config 설정](/docs/config)을 권장합니다.
|
||||
자신의 워크플로우에 맞추려면 [테마 선택](/docs/themes), [키바인드 사용자 지정](/docs/keybinds), [코드 포매터 설정](/docs/formatters), [커스텀 명령 작성](/docs/commands), [OpenCode 구성 조정](/docs/config)을 추천합니다.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
title: 키바인드
|
||||
description: 키바인드를 커스터마이즈하세요.
|
||||
description: 키바인드를 사용자 지정하세요.
|
||||
---
|
||||
|
||||
OpenCode에는 OpenCode config를 통해 커스터마이즈할 수 있는 keybinds 목록이 있습니다.
|
||||
opencode는 opencode config를 통해 사용자 정의 할 수있는 keybinds 목록을 가지고 있습니다.
|
||||
|
||||
```json title="opencode.json"
|
||||
{
|
||||
@@ -107,17 +107,17 @@ OpenCode에는 OpenCode config를 통해 커스터마이즈할 수 있는 keybin
|
||||
|
||||
## 리더 키
|
||||
|
||||
OpenCode는 대부분의 keybinds에 `leader` 키를 사용합니다. 이렇게 하면 terminal에서 충돌을 피할 수 있습니다.
|
||||
opencode는 대부분의 keybinds에 대한 `leader` 키를 사용합니다. 이것은 당신의 terminal에 있는 충돌을 피합니다.
|
||||
|
||||
기본값으로 `ctrl+x`가 리더 키이며, 대부분의 작업은 먼저 리더 키를 누른 뒤 단축키를 누릅니다. 예를 들어 새 세션을 시작하려면 먼저 `ctrl+x`를 누르고 `n`을 누릅니다.
|
||||
기본적으로 `ctrl+x`는 리더 키이며 대부분의 작업은 리더 키를 먼저 누르고 단축키를 누릅니다. 예를 들어, 새 세션을 시작하려면 먼저 `ctrl+x`를 누르고 `n`를 누릅니다.
|
||||
|
||||
keybinds에 리더 키를 꼭 사용할 필요는 없지만, 사용하는 것을 권장합니다.
|
||||
키바인드에 리더 키를 사용할 필요는 없지만, 사용하는 것을 권장합니다.
|
||||
|
||||
---
|
||||
|
||||
## 키바인드 비활성화
|
||||
|
||||
config에 해당 키를 값 `"none"`으로 추가하면 keybind를 비활성화할 수 있습니다.
|
||||
"none"의 값으로 구성에 키를 추가하여 keybind를 비활성화 할 수 있습니다.
|
||||
|
||||
```json title="opencode.json"
|
||||
{
|
||||
@@ -132,39 +132,39 @@ config에 해당 키를 값 `"none"`으로 추가하면 keybind를 비활성화
|
||||
|
||||
## 데스크탑 프롬프트 단축키
|
||||
|
||||
OpenCode 데스크톱 앱의 프롬프트 입력은 텍스트 편집을 위한 일반적인 Readline/Emacs-style 단축키를 지원합니다. 이 단축키는 내장되어 있으며 현재 `opencode.json`으로는 설정할 수 없습니다.
|
||||
opencode 데스크톱 앱 프롬프트 입력은 텍스트 편집을 위한 일반적인 Readline/Emacs-style 단축키를 지원합니다. 이들은 내장되어 있으며 현재 `opencode.json`를 통해 구성할 수 없습니다.
|
||||
|
||||
| 단축키 | 동작 |
|
||||
| -------- | --------------------------------- |
|
||||
| `ctrl+a` | 현재 줄 시작으로 이동 |
|
||||
| `ctrl+e` | 현재 줄 끝으로 이동 |
|
||||
| `ctrl+b` | 커서를 문자 하나 뒤로 이동 |
|
||||
| `ctrl+f` | 커서를 문자 하나 앞으로 이동 |
|
||||
| `alt+b` | 커서를 단어 하나 뒤로 이동 |
|
||||
| `alt+f` | 커서를 단어 하나 앞으로 이동 |
|
||||
| `ctrl+d` | 커서 아래 문자 삭제 |
|
||||
| `ctrl+k` | 줄 끝까지 삭제 |
|
||||
| `ctrl+u` | 줄 시작까지 삭제 |
|
||||
| `ctrl+w` | 이전 단어 삭제 |
|
||||
| `alt+d` | 다음 단어 삭제 |
|
||||
| `ctrl+t` | 문자 순서 바꾸기 |
|
||||
| `ctrl+g` | 팝오버 취소 / 실행 중인 응답 중단 |
|
||||
| 단축키 | 동작 |
|
||||
| -------- | -------------------------- |
|
||||
| `ctrl+a` | 현재 행 시작으로 이동 |
|
||||
| `ctrl+e` | 현재선 끝으로 이동 |
|
||||
| `ctrl+b` | 커서를 다시 한 문자로 이동 |
|
||||
| `ctrl+f` | 한자 앞의 커서 |
|
||||
| `alt+b` | 한 단어로 커서 이동 |
|
||||
| `alt+f` | 한 단어를 넘겨 주세요 |
|
||||
| `ctrl+d` | 커서의 캐릭터 삭제 |
|
||||
| `ctrl+k` | 노선의 종료 |
|
||||
| `ctrl+u` | 노선 시작 |
|
||||
| `ctrl+w` | 이전 단어 |
|
||||
| `alt+d` | 다음 단어를 죽이기 |
|
||||
| `ctrl+t` | 자가용 캐릭터 |
|
||||
| `ctrl+g` | 팝오버를 취소 / 응답 취소 |
|
||||
|
||||
---
|
||||
|
||||
## Shift+Enter
|
||||
|
||||
일부 terminal은 기본적으로 Enter와 modifier 키 조합을 전송하지 않습니다. `Shift+Enter`를 이스케이프 시퀀스로 전송하도록 terminal을 설정해야 할 수도 있습니다.
|
||||
몇몇 terminal은 기본적으로 입력한 보조 키를 보내지 않습니다. `Shift+Enter`를 이스케이프 시퀀스로 보낼 terminal을 구성해야 할 수 있습니다.
|
||||
|
||||
### Windows Terminal
|
||||
|
||||
다음 경로의 `settings.json`을 여세요:
|
||||
`settings.json`를 엽니다:
|
||||
|
||||
```
|
||||
%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
|
||||
```
|
||||
|
||||
루트 레벨 `actions` 배열에 다음을 추가하세요:
|
||||
루트 레벨 `actions` 배열에 이것을 추가하십시오:
|
||||
|
||||
```json
|
||||
"actions": [
|
||||
@@ -178,7 +178,7 @@ OpenCode 데스크톱 앱의 프롬프트 입력은 텍스트 편집을 위한
|
||||
]
|
||||
```
|
||||
|
||||
루트 레벨 `keybindings` 배열에 다음을 추가하세요:
|
||||
루트 레벨 `keybindings` 배열에 이것을 추가하십시오:
|
||||
|
||||
```json
|
||||
"keybindings": [
|
||||
@@ -189,4 +189,4 @@ OpenCode 데스크톱 앱의 프롬프트 입력은 텍스트 편집을 위한
|
||||
]
|
||||
```
|
||||
|
||||
파일을 저장한 뒤 Windows Terminal을 다시 시작하거나 새 탭을 여세요.
|
||||
파일을 저장하고 Windows Terminal을 다시 시작하거나 새 탭을 엽니 다.
|
||||
|
||||
@@ -1,63 +1,62 @@
|
||||
---
|
||||
title: LSP 서버
|
||||
description: OpenCode는 LSP 서버와 통합됩니다.
|
||||
description: OpenCode는 LSP 서버와 통합되어 작동합니다.
|
||||
---
|
||||
|
||||
OpenCode는 Language Server Protocol(LSP)과 통합되어 LLM이 코드베이스와 상호작용하도록 돕습니다. 진단 정보를 활용해 LLM에 피드백을 제공합니다.
|
||||
OpenCode는 언어 서버 프로토콜(LSP)과 통합되어 LLM이 코드베이스와 상호 작용할 수 있게 돕습니다. 이를 통해 진단 정보를 사용하여 LLM에 피드백을 제공합니다.
|
||||
|
||||
---
|
||||
|
||||
## 기본 제공 (Built-in)
|
||||
|
||||
OpenCode는 널리 사용되는 언어를 위해 여러 built-in LSP 서버를 제공합니다.
|
||||
OpenCode는 인기 있는 언어들에 대해 여러 내장 LSP 서버를 제공합니다.
|
||||
|
||||
| LSP 서버 | 확장자 | 요구 사항 |
|
||||
| ------------------ | ------------------------------------------------------------------- | ---------------------------------------------------------- |
|
||||
| astro | .astro | Astro 프로젝트에서 자동 설치 |
|
||||
| bash | .sh, .bash, .zsh, .ksh | `bash-language-server` 자동 설치 |
|
||||
| clangd | .c, .cpp, .cc, .cxx, .c++, .h, .hpp, .hh, .hxx, .h++ | C/C++ 프로젝트에서 자동 설치 |
|
||||
| csharp | .cs | `.NET SDK` 설치됨 |
|
||||
| clojure-lsp | .clj, .cljs, .cljc, .edn | `clojure-lsp` 명령 사용 가능 |
|
||||
| dart | .dart | `dart` 명령 사용 가능 |
|
||||
| deno | .ts, .tsx, .js, .jsx, .mjs | `deno` 명령 사용 가능 (`deno.json`/`deno.jsonc` 자동 감지) |
|
||||
| elixir-ls | .ex, .exs | `elixir` 명령 사용 가능 |
|
||||
| eslint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue | 프로젝트에 `eslint` dependency 존재 |
|
||||
| fsharp | .fs, .fsi, .fsx, .fsscript | `.NET SDK` 설치됨 |
|
||||
| gleam | .gleam | `gleam` 명령 사용 가능 |
|
||||
| gopls | .go | `go` 명령 사용 가능 |
|
||||
| hls | .hs, .lhs | `haskell-language-server-wrapper` 명령 사용 가능 |
|
||||
| jdtls | .java | `Java SDK (version 21+)` 설치됨 |
|
||||
| julials | .jl | `julia` 및 `LanguageServer.jl` 설치됨 |
|
||||
| kotlin-ls | .kt, .kts | Kotlin 프로젝트에서 자동 설치 |
|
||||
| lua-ls | .lua | Lua 프로젝트에서 자동 설치 |
|
||||
| nixd | .nix | `nixd` 명령 사용 가능 |
|
||||
| ocaml-lsp | .ml, .mli | `ocamllsp` 명령 사용 가능 |
|
||||
| oxlint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue, .astro, .svelte | 프로젝트에 `oxlint` dependency 존재 |
|
||||
| php intelephense | .php | PHP 프로젝트에서 자동 설치 |
|
||||
| prisma | .prisma | `prisma` 명령 사용 가능 |
|
||||
| pyright | .py, .pyi | `pyright` dependency 설치됨 |
|
||||
| ruby-lsp (rubocop) | .rb, .rake, .gemspec, .ru | `ruby` 및 `gem` 명령 사용 가능 |
|
||||
| rust | .rs | `rust-analyzer` 명령 사용 가능 |
|
||||
| sourcekit-lsp | .swift, .objc, .objcpp | `swift` 설치됨 (macOS에서는 `xcode`) |
|
||||
| svelte | .svelte | Svelte 프로젝트에서 자동 설치 |
|
||||
| terraform | .tf, .tfvars | GitHub releases에서 자동 설치 |
|
||||
| tinymist | .typ, .typc | GitHub releases에서 자동 설치 |
|
||||
| typescript | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts | 프로젝트에 `typescript` dependency 존재 |
|
||||
| vue | .vue | Vue 프로젝트에서 자동 설치 |
|
||||
| yaml-ls | .yaml, .yml | Red Hat `yaml-language-server` 자동 설치 |
|
||||
| zls | .zig, .zon | `zig` 명령 사용 가능 |
|
||||
| LSP 서버 | 확장자 | 요구사항 |
|
||||
| ------------------ | ------------------------------------------------------------------ | ----------------------------------------------------- |
|
||||
| astro | .astro | Astro 프로젝트 자동 설치 |
|
||||
| bash | .sh, .bash, .zsh, .ksh | bash-language-server 자동 설치 |
|
||||
| clangd | .c, .cpp, .cc, .cxx, .c++, .h, .hpp, .hh, .hxx, .h++ | C/C++ 프로젝트용 자동 설치 |
|
||||
| csharp | .cs | `.NET SDK` 설치 |
|
||||
| clojure-lsp | .clj, .cljs, .cljc, .edn | `clojure-lsp` 명령 사용 가능 |
|
||||
| dart | .dart | `dart` 명령 사용 가능 |
|
||||
| deno | .ts, .tsx, .js, .jsx, .mjs | `deno` 명령 사용 가능(deno.json/deno.jsonc 자동 감지) |
|
||||
| elixir-ls | .ex, .exs | `elixir` 명령 사용 가능 |
|
||||
| eslint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue | 프로젝트의 `eslint` 의존성 |
|
||||
| fsharp | .fs, .fsi, .fsx, .fsscript | `.NET SDK` 설치 |
|
||||
| gleam | .gleam | `gleam` 명령 사용 가능 |
|
||||
| gopls | .go | `go` 명령 사용 가능 |
|
||||
| hls | .hs, .lhs | `haskell-language-server-wrapper` 명령 사용 가능 |
|
||||
| jdtls | .java | `Java SDK (version 21+)` 설치 |
|
||||
| kotlin-ls | .kt, .kts | Kotlin 프로젝트용 자동 설치 |
|
||||
| lua-ls | .lua | Lua 프로젝트용 자동 설치 |
|
||||
| nixd | .nix | `nixd` 명령 사용 가능 |
|
||||
| ocaml-lsp | .ml, .mli | `ocamllsp` 명령 사용 가능 |
|
||||
| oxlint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .ct, .vue, .astro, .svelte | 프로젝트의 `oxlint` 의존성 |
|
||||
| PHP intelephense | .php | PHP 프로젝트 자동 설치 |
|
||||
| prisma | .prisma | `prisma` 명령 사용 가능 |
|
||||
| pyright | .py, .pyi | `pyright` 의존성 설치 |
|
||||
| ruby-lsp (rubocop) | .rb, .rake, .gemspec, .ru | `ruby` 및 `gem` 명령 사용 가능 |
|
||||
| rust | .rs | `rust-analyzer` 명령 사용 가능 |
|
||||
| sourcekit-lsp | .swift, .objc, .objcpp | `swift` 설치 (macOS의 `xcode`) |
|
||||
| svelte | .svelte | Svelte 프로젝트 자동 설치 |
|
||||
| terraform | .tf, .tfvars | GitHub 릴리스에서 자동 설치 |
|
||||
| typst | .typ, .typc | GitHub 릴리스에서 자동 설치 |
|
||||
| typescript | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts | 프로젝트의 `typescript` 의존성 |
|
||||
| vue | .vue | Vue 프로젝트 자동 설치 |
|
||||
| yaml-ls | .yaml, .yml | Red Hat yaml-language-server 자동 설치 |
|
||||
| zls | .zig, .zon | `zig` 명령 사용 가능 |
|
||||
|
||||
위 확장자 중 하나가 감지되고 요구 사항이 충족되면 LSP 서버가 자동으로 활성화됩니다.
|
||||
LSP 서버는 위 파일 확장자 중 하나가 감지되고 요구 사항이 충족되면 자동으로 활성화됩니다.
|
||||
|
||||
:::note
|
||||
`OPENCODE_DISABLE_LSP_DOWNLOAD` 환경 변수를 `true`로 설정하면 LSP 서버 자동 다운로드를 비활성화할 수 있습니다.
|
||||
`OPENCODE_DISABLE_LSP_DOWNLOAD` 환경 변수를 `true`로 설정하여 자동 LSP 서버 다운로드를 비활성화 할 수 있습니다.
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
## 작동 방식
|
||||
|
||||
OpenCode가 파일을 열면 다음과 같이 동작합니다.
|
||||
OpenCode가 파일을 열 때, 다음과 같이 작동합니다:
|
||||
|
||||
1. 활성화된 모든 LSP 서버에 대해 파일 확장자를 확인합니다.
|
||||
2. 적절한 LSP 서버가 아직 실행 중이지 않다면 시작합니다.
|
||||
@@ -66,7 +65,7 @@ OpenCode가 파일을 열면 다음과 같이 동작합니다.
|
||||
|
||||
## 구성
|
||||
|
||||
OpenCode config의 `lsp` 섹션에서 LSP 서버를 사용자 정의할 수 있습니다.
|
||||
OpenCode 설정의 `lsp` 섹션을 통해 LSP 서버를 사용자 정의할 수 있습니다.
|
||||
|
||||
```json title="opencode.json"
|
||||
{
|
||||
@@ -75,23 +74,23 @@ OpenCode config의 `lsp` 섹션에서 LSP 서버를 사용자 정의할 수 있
|
||||
}
|
||||
```
|
||||
|
||||
각 LSP 서버는 다음 속성을 지원합니다.
|
||||
각 LSP 서버는 다음을 지원합니다:
|
||||
|
||||
| 속성 | 타입 | 설명 |
|
||||
| ---------------- | -------- | --------------------------------------------- |
|
||||
| `disabled` | boolean | LSP 서버를 비활성화하려면 `true`로 설정하세요 |
|
||||
| `command` | string[] | LSP 서버를 시작하는 명령입니다 |
|
||||
| `extensions` | string[] | 이 LSP 서버가 처리할 파일 확장자입니다 |
|
||||
| `env` | object | 서버 시작 시 설정할 환경 변수입니다 |
|
||||
| `initialization` | object | LSP 서버로 전송할 초기화 옵션입니다 |
|
||||
| 속성 | 유형 | 설명 |
|
||||
| ---------------- | -------- | --------------------------------------- |
|
||||
| `disabled` | boolean | LSP 서버를 비활성화하려면 `true`로 설정 |
|
||||
| `command` | string[] | LSP 서버를 시작하는 명령 |
|
||||
| `extensions` | string[] | 이 LSP 서버의 확장자 |
|
||||
| `env` | object | 서버 시작 시 설정할 환경 변수 |
|
||||
| `initialization` | object | LSP 서버에 보내는 초기화 옵션 |
|
||||
|
||||
예시를 살펴보겠습니다.
|
||||
몇 가지 예제를 살펴봅시다.
|
||||
|
||||
---
|
||||
|
||||
### 환경 변수
|
||||
## 환경 변수
|
||||
|
||||
`env` 속성을 사용하면 LSP 서버 시작 시 환경 변수를 설정할 수 있습니다.
|
||||
`env` 속성을 사용하여 LSP 서버를 시작할 때 환경 변수를 설정합니다.
|
||||
|
||||
```json title="opencode.json" {5-7}
|
||||
{
|
||||
@@ -110,7 +109,7 @@ OpenCode config의 `lsp` 섹션에서 LSP 서버를 사용자 정의할 수 있
|
||||
|
||||
### 초기화 옵션
|
||||
|
||||
`initialization` 속성을 사용해 LSP 서버에 초기화 옵션을 전달하세요. 이 값은 LSP `initialize` 요청 중에 전송되는 서버별 설정입니다.
|
||||
`initialization` 속성을 사용하여 초기화 옵션을 LSP 서버에 전달합니다. 이들은 LSP `initialize` 요청에 보내진 서버 별 설정입니다.
|
||||
|
||||
```json title="opencode.json" {5-9}
|
||||
{
|
||||
@@ -128,14 +127,14 @@ OpenCode config의 `lsp` 섹션에서 LSP 서버를 사용자 정의할 수 있
|
||||
```
|
||||
|
||||
:::note
|
||||
초기화 옵션은 LSP 서버마다 다릅니다. 사용 가능한 옵션은 해당 LSP 서버 문서를 확인하세요.
|
||||
초기화 옵션은 LSP 서버가 다릅니다. LSP 서버의 사용 가능한 옵션을 확인하세요.
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
### LSP 서버 비활성화
|
||||
|
||||
전역에서 **모든** LSP 서버를 비활성화하려면 `lsp`를 `false`로 설정하세요.
|
||||
전역적으로 **모든** LSP 서버를 비활성화하려면 `lsp`를 `false`로 설정하십시오.
|
||||
|
||||
```json title="opencode.json" {3}
|
||||
{
|
||||
@@ -144,7 +143,7 @@ OpenCode config의 `lsp` 섹션에서 LSP 서버를 사용자 정의할 수 있
|
||||
}
|
||||
```
|
||||
|
||||
**특정** LSP 서버를 비활성화하려면 `disabled`를 `true`로 설정하세요.
|
||||
**특정** LSP 서버를 비활성화하려면 `disabled`를 `true`로 설정하십시오.
|
||||
|
||||
```json title="opencode.json" {5}
|
||||
{
|
||||
@@ -161,7 +160,7 @@ OpenCode config의 `lsp` 섹션에서 LSP 서버를 사용자 정의할 수 있
|
||||
|
||||
## 사용자 정의 LSP 서버
|
||||
|
||||
명령과 파일 확장자를 지정해 사용자 정의 LSP 서버를 추가할 수 있습니다.
|
||||
명령어와 파일 확장자를 지정하여 사용자 정의 LSP 서버를 추가할 수 있습니다.
|
||||
|
||||
```json title="opencode.json" {4-7}
|
||||
{
|
||||
@@ -181,9 +180,9 @@ OpenCode config의 `lsp` 섹션에서 LSP 서버를 사용자 정의할 수 있
|
||||
|
||||
### PHP Intelephense
|
||||
|
||||
PHP Intelephense는 라이선스 키를 통해 프리미엄 기능을 제공합니다. 텍스트 파일에 키만 저장해 라이선스 키를 제공할 수 있습니다.
|
||||
PHP Intelephense는 라이선스 키를 통해 프리미엄 기능을 제공합니다. 텍스트 파일에 키(만)를 저장하여 라이선스 키를 제공할 수 있습니다.
|
||||
|
||||
- macOS/Linux: `$HOME/intelephense/license.txt`
|
||||
- Windows: `%USERPROFILE%/intelephense/license.txt`
|
||||
|
||||
파일에는 추가 내용 없이 라이선스 키만 포함하는 것이 좋습니다.
|
||||
파일에는 다른 내용이 없어야 합니다.
|
||||
|
||||