YAML Editor online

Code

Export

My documents

Click a document to open it. They are stored only in this browser - nothing is uploaded. Clearing the browser's site data removes them, so download the ones you want to keep.

AI Assistant

Any AI can work with you - ChatGPT, Claude, Gemini, Copilot.

  1. Click Copy prompt.
  2. Paste it into your AI and say what it should change.
The AI should

The document travels in the link after the “#”, which no server sees. What you paste into your AI is handled by its provider.

Save to your server

The editor can send each saved version to your own server (a webhook), so your work is kept where you want it. Nothing is sent until you enter an address here.

What your server receives

A POST request with JSON (your server must allow CORS from https://yaml.giit.ch); content is the document as a string:

{ "editor": "yaml", "event": "save", "id": "…", "name": "Settings",
  "content": "debug: false\nport: 8080\n",
  "updated": "2026-01-15T09:30:00.000Z" }
Embed the editor in your website
<iframe src="https://yaml.giit.ch/?embed=1" style="width:100%;height:80vh;border:0"></iframe>
<script>
const frame = document.querySelector('iframe');
addEventListener('message', e => {
  if (e.origin !== 'https://yaml.giit.ch' || e.source !== frame.contentWindow) return;
  if (e.data.type === 'yamleditor:ready')
    frame.contentWindow.postMessage({ type: 'yamleditor:load', name: 'Settings',
      content: settingsYaml }, 'https://yaml.giit.ch');
  if (e.data.type === 'yamleditor:save') saveOnYourServer(e.data.content);
});
</script>

Also possible: ?src=<URL of a .yaml file> opens a file, &webhook=<URL> saves this document there. The editor can also open in a window of its own (?embed=window), and your page can hand it its own AI prompt and a session key so the AI sends its result to your server (yamleditor:ai, yamleditor:key-request) - see "Use the editor on your own website" below the editor. Details are in llms.txt.

Help

How it works

  1. Write YAML on the left - or start with New and one of the templates. The tree in the middle shows the data as you type: mappings and lists fold, every value shows its type, {3} and [5] count the entries, every document after --- has its own tree.
  2. Click a key or a value in the tree to change it right there. Enter or a click elsewhere writes the change into the code at exactly that place - comments and formatting stay (one step for Undo), Escape cancels. The buttons above the tree add, duplicate, move and remove entries and change the type of a value.
  3. A click in the tree puts the code's cursor on that value; the cursor in the code marks its value in the tree. The path of the selected value ($.items[3].name) is below the tree. Anchors (&name) and aliases (*name) are marked.
  4. Problems (wrong indentation, a tab, a duplicate key, an alias without its anchor, what does not fit the schema) are listed above the code with line and column - click one to go there.
  5. Value on the right shows the selected key and value; Insert adds entries and pieces of code; Convert formats the document or converts it to JSON, CSV or XML; Schema checks it against a JSON Schema from your documents.
  6. My documents (the folder button at the top left) lists every document kept in this browser. Export saves it as YAML, JSON, CSV or text.

Keyboard shortcuts

↑ ↓ ← →
In the tree: go up and down, fold and unfold
Enter
In the tree: change the value (F2: the key)
Delete
In the tree: remove the entry
Alt + ↑ / ↓
In the tree: move the entry up / down
Ctrl + F
Search keys and values in the tree
Ctrl + Shift + F
Format the document
Tab / Shift + Tab
Indent / outdent in the code (with spaces)
Ctrl + /
Comment lines in or out (#)
Ctrl + Z / Y
Undo / redo
Ctrl + S / E
Save (download, or to your server) / export
Ctrl + O
My documents

Enter after key: indents the next line, Enter in a list starts the next item with - . Quotes and brackets close by themselves around a selection.

YAML をコードとツリーでオンライン編集

YAML エディターは、YAML コードとツリー表示のデータを並べて表示します。マッピングとリストを折りたたみ、各値の型と項目数を確認し、ツリーで直接キーと値を変更できます。変更はコードのちょうどその位置に書き込まれ、コメントと書式は残ります。エラーは、誤ったインデントからタブ、アンカーのないエイリアスまで行と列付きで一覧表示され、データを JSON Schema で検証したり、JSON、CSV、XML に変換したりできます。

すべてブラウザー内で動作します。ドキュメントはアップロードされず、登録も広告もありません。

エディターでできること

コードとツリー

左側にハイライト付きの YAML 1.2、中央に折りたためるツリー (--- の後のドキュメントごとに 1 つのツリー)。ツリーをクリックするとコードへ移動し、コードのカーソル位置の値がツリーで示されます。

ツリーで編集、コメントはそのまま

キーと値の変更、項目の追加、複製、移動、削除、型の変更。それぞれがコードへの小さな編集なので、コメントと空行はそのまま残ります。

見つけやすいエラー

誤ったインデント、タブ、重複したキー、アンカーのないエイリアス、JSON Schema に適合しない値を、それぞれ行と列付きで示します。

アンカーとエイリアス

&anchor、*alias、マージキー (<<) はツリーで示され、変換時には解決されます。

変換

一貫したインデントで整形、または JSON、CSV (マッピングのリストは表になります)、XML に変換。JSON、CSV、XML ファイルは YAML として開きます。

多数のドキュメント

ドキュメントをいくつでもブラウザー内に保管でき、それぞれに元に戻す履歴があり、すべてを ZIP でダウンロードできます。

使い方

  1. 始める - 「新規」でテンプレート (Docker Compose、GitHub ワークフロー、Kubernetes、OpenAPI) を選ぶか、.yaml ファイルを開くか、YAML を貼り付けます。
  2. 編集 - コードでもツリーでも編集できます。両方とも常に同じデータを表示します。
  3. 検証とエクスポート - 一覧の問題を直し、スキーマを選び、YAML、JSON、CSV、テキストをダウンロードします。

エディターを自分の Web サイトで使う

https のページ (および localhost) なら、<iframe> と ?embed=1 でエディターを埋め込めます。登録もキーも不要です。埋め込まれたエディターはこの説明文を隠し、保存ボタンを表示します。ドキュメントを受け渡す方法は 2 つあります。

1. リンクからファイルを開き、自分のサーバーに保存する

src= でファイルを開き (サーバーで CORS の許可が必要)、webhook= を指定すると「保存」(Ctrl+S) でドキュメントがそのアドレスに送信されます。&token=… を付けると Authorization: Bearer … ヘッダーが付き、&auto を付けると変更のたびに保存します。

<iframe src="https://yaml.giit.ch/?embed=1&src=https://your-site.com/config/app.yaml&webhook=https://your-site.com/save.php"
        allow="clipboard-write" style="width:100%;height:800px;border:0"></iframe>

Webhook は JSON { editor: "yaml", event: "save", id, name, content, updated } を含む POST を受け取ります。content はドキュメントの文字列です。それを保存する小さな PHP スクリプト:

<?php
header('Access-Control-Allow-Origin: https://yaml.giit.ch');
header('Access-Control-Allow-Headers: Content-Type, Authorization');
header('Access-Control-Allow-Methods: POST, OPTIONS');
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') exit;
if (($_SERVER['HTTP_AUTHORIZATION'] ?? '') !== 'Bearer SECRET') { http_response_code(403); exit; }
$d = json_decode(file_get_contents('php://input'), true);
$name = preg_replace('/[^\w\- ]/u', '_', $d['name']);
file_put_contents(__DIR__ . "/config/$name.yaml", $d['content']);
echo '{"ok":true}';

2. ページがドキュメントを保持する (postMessage)

エディターが yamleditor:ready を送り、ページが yamleditor:load で応答すると、エディターは yamleditor:loaded を返し、実際に編集されると yamleditor:change、ユーザーが保存すると yamleditor:save を送ります。ページからは yamleditor:get (現在の状態) や yamleditor:save (保存ボタンを押す) を送れます。保存はあなた自身のログインとセッションを通して行われます。

<iframe id="ed" src="https://yaml.giit.ch/?embed=1" allow="clipboard-write" style="width:100%;height:800px;border:0"></iframe>
<script>
const ed = document.getElementById('ed');
const ORIGIN = 'https://yaml.giit.ch';

addEventListener('message', async e => {
  if (e.source !== ed.contentWindow || e.origin !== ORIGIN) return;
  const m = e.data;
  if (m.type === 'yamleditor:ready') {              // エディターの準備完了: ドキュメントを渡す
    ed.contentWindow.postMessage({
      type: 'yamleditor:load',
      name: 'Settings',
      content: await (await fetch('/config/app.yaml')).text()
    }, ORIGIN);
  }
  if (m.type === 'yamleditor:change') document.title = '● not saved';   // 実際の編集
  if (m.type === 'yamleditor:save') {               // ユーザーが「保存」をクリックした
    await fetch('/api/save', { method: 'POST', headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ name: m.name, content: m.content }) });
    document.title = 'Saved';
  }
});

// 自分のページの保存ボタン: 応答は yamleditor:save として届く
function saveNow() { ed.contentWindow.postMessage({ type: 'yamleditor:get' }, ORIGIN); }
</script>

ページ内の AI アシスタント: フレーム内でも動作します。iframe に allow="clipboard-write" を付けると、「プロンプトをコピー」がクリップボードを直接使います (付けない場合は古いコピーコマンドを使うか、手動でコピーできるようプロンプトを表示します)。AI が送るリンクはほかの Web サイト内のエディターには届かないため、エディターは AI とユーザーに、代わりに AI の回答全体をエディターに貼り付けるよう案内します。または、エディターを専用のウィンドウで開いてください。

3. 専用のウィンドウで開く

window.open("https://yaml.giit.ch/?embed=window", "yamleditor-17") は完全なエディターを専用のウィンドウで開き、window.opener と同じメッセージをやり取りします。AI からのリンクもそこに届きます。yamleditor:load には context: { host, title, rules } (AI プロンプトがドキュメントの所属先を伝え、あなたのルールに従います) と hook: { url, token } (このドキュメント専用で保存されない Webhook) も含められます。未保存の変更があるままウィンドウを閉じると yamleditor:closing が送られます。

4. 自分のサーバー経由の AI

エディターに独自のプロンプト、サイト上のアドレス、このエディターセッション用のキーを渡します。すると AI ダイアログには、あなたのサイトへの「接続先」、AI に伝える内容、そして 現在のドキュメントを変更 か 新しいドキュメントを作成 の選択肢が表示され、プロンプトをコピー ですべてがまとめられます。AI はキーを付けて結果をあなたのサーバーに送り、ページがそれをエディターで開きます。新しいドキュメントは別に開き、ユーザーのブラウザー内に残ります。キーはエディターセッションごとに 1 つです。エディターを開いている間は有効で、キーがないときだけエディターが yamleditor:key-request で要求します。エディターがキーを自分で送ったり保存したりすることはありません。アドレスはあなた自身のホストまたはそのサブドメイン上の https である必要があります。

const key = async () => (await fetch('/api/ai-key.php?doc=17')).json();   // エディターセッションごとにキーを 1 つ
const k = await key();
ed.contentWindow.postMessage({ type: 'yamleditor:load', name: 'Settings', content, ai: {
  label: 'My Site', prompt: 'Keep every key and every comment.',
  endpoint: 'https://your-site.com/api/ai-result.php', key: k.key } }, ORIGIN);
// yamleditor:loaded の id を覚えておき、別の id の change/save/closing は無視する
// エディターにキーがないときだけ:
if (m.type === 'yamleditor:key-request') { const k = await key(); ed.contentWindow.postMessage({ type: 'yamleditor:ai', key: k.key }, ORIGIN); }
// エディターを開いている間、毎分サーバーに知らせる。エディターまたはページを閉じるとキーは無効になる
setInterval(() => fetch('/api/ai-key.php?alive=' + k.key.slice(0, 8)), 60000);
// サーバーに結果がある (ポーリング、SSE …): target は "current" または "new"
ed.contentWindow.postMessage({ type: 'yamleditor:load', name: 'Settings', content: draft, from: 'ai', target }, ORIGIN);

キーは 128 ビット以上のランダム値で作り、ハッシュだけを保存し、それぞれをログイン中のユーザー、ドキュメント、このエディターセッションに結び付けてください。キーはセッションごとに 1 つ作り、ページがセッションを開いていると報告している間だけ有効にし、エディターまたはページが閉じたら無効にしてください。

プロトコルの全体は llms.txt にあります。AI に渡せば、あなたのシステム用の接続を作ってくれます。JSON エディターも接頭辞 jsoneditor: で同じように動作します - json.giit.ch。

よくある質問

データはアップロードされますか?

いいえ。エディターは完全にブラウザー内で動作します。自分で自分のサーバーへの Webhook を設定しない限り、ドキュメントがサーバーに送られることはありません。

ツリーで編集してもコメントは残りますか?

はい。ツリーでの変更はコードのちょうどその位置に書き込まれ、コメント、空行、そのほかの書式はそのまま残ります。「元に戻す」ですべての変更を戻せます。

エディターがタブについて警告するのはなぜですか?

YAML ではインデントにタブを使えません。エディターはそのすべての箇所に印を付け、コード内の Tab キーではスペースが入力されます。

アンカー、エイリアス、複数のドキュメントを理解しますか?

はい。アンカー (&name) とエイリアス (*name) はツリーで示され、マージキー (<<) は変換時に解決され、アンカーのないエイリアスは報告され、--- の後の各ドキュメントには専用のツリーがあります。

YAML を JSON、CSV、XML に変換できますか?

はい、変換 タブまたはエクスポートでできます。マッピングのリストは CSV の表になります。開いた JSON、CSV、XML ファイルは YAML に変換されます。

ドキュメントはどこに保存されますか?

ブラウザー内だけです。左上のフォルダーボタン (マイドキュメント) をクリックすると、開く、名前の変更、複製、ダウンロード、削除ができます。ブラウザーのサイトデータを消去すると削除されるので、残したいものはダウンロードするか、エディターから自分のサーバーに送ってください (「サーバーに保存」)。

AI に YAML エディターで書いてもらえますか?

はい、どの AI でも使えます。ChatGPT、Claude、Gemini、Copilot、またはコーディングツールの AI です。「AI アシスタント」、続いて「プロンプトをコピー」をクリックし、AI に貼り付けて何を変更するか伝えてください。AI はリンクで回答します。クリックするとデータがエディターに表示されます。「元に戻す」ですべての変更を戻せます。

YAML エディターは有料ですか?

いいえ。エディターは無料で、広告も登録もありません。