Files
Riskey 17ce877aa5 Release/1.16.0 (#848)
* docs: add New Agent user guide and node tab

* docs: add ENABLE_AGENT_V2 to environment variable reference

* translate: add zh and ja New Agent documentation

* docs: add New Agent navigation groups

* feat: add limits and quotas rule to style guide

* docs: add skill and file upload limits to New Agent guide

* fix: redirect new-agent doc paths from UI links to self-host pages

* docs: add task examples and refine New Agent pages

* docs: update New Agent data security notice per legal

* docs: extend security notice coverage and build note explanation

Surface the legal data security Warning on the Build page and New Agent node tab (en/zh/ja), and explain the build note as the agent's memory across build chats with an example.

* docs: refine New Agent guidance and cross-link from classic Agent

Model note gains the older-model sandbox symptom; node opener differentiates from the classic node; Build page restructured (review bullets, Info callout, section links) with zh/ja synced; classic Agent app page (self-host) gains a New Agent Tip.

* docs: document memory, permissions, and sandbox facts for New Agent

Verified additions: per-conversation memory bounded by the model's context window; Editor-tier permissions for creating and managing agents; unrestricted sandbox network access; version restore excludes the sandbox environment; build note deletion and regeneration behavior.

* docs: rename Roster to Agent page across New Agent docs

The UI removed the Roster concept; the nav entry is now Agent. Updated pages, node tab titles, image alt text, and the ENABLE_AGENT_V2 reference entry in en/zh/ja. Agent Console button labels are unchanged in the UI and stay verbatim.

* docs: add files vs knowledge guidance and restructure page openers

Decision aid for uploading as Files vs connecting a knowledge base (read-in-full vs search), knowledge opener gains relevance and workspace-asset framing, overview and build intros restructured.

* docs: update docker compose container list and add tool prerequisites (#843)

* docs: update docker compose container list and add tool prerequisites

- Add api_websocket and init_permissions to the started-container list per the current compose defaults
- Remove outdated sample outputs for docker compose up and docker compose ps
- Add a callout noting the clone command requires git, curl, and jq, with recovery guidance on command not found errors
- Mirror all changes to zh and ja

* docs: note expected exited status for init_permissions container

* fix: align tools page tab titles across languages and fix anchors

Shorten the Swagger and Workflow tab titles ("Swagger API as Tool" ->
"Swagger API", "Workflow as Tool" -> "Workflow") in en, zh, and ja so all
three languages generate the same tab anchors. Update the inbound links in
output.mdx that pointed at the old Workflow-tab anchor (#workflow-as-tool,
#工作流作为工具, #ワークフローをツールとして利用) to #workflow.

* feat: consolidate and restructure the API reference (Phase 1) (#846)

* docs: correct HITL API integration flow and sync translations

- Fix the claim that the resume endpoint differs per app type (same
  endpoint; only the entry endpoint differs)
- Tie workflow_run_id guidance to the human_input_required event
  (chatflow message chunks don't carry it)
- Require the same user when resuming the event stream (mismatch
  returns 404); add include_state_snapshot and continue_on_pause
  guidance
- Note at the capture step that a null form_token means Email delivery
- Soften the upload-time validation claim to file size limits
- Split long paragraphs; align zh endpoint name with the reference page

* fix: correct API references against verified backend behavior

Audit of the Service API specs against dify hotfix/1.15.0-fix.1, with
every change code-verified and the serious items adversarially
confirmed. Applies to en/zh/ja.

- Add curl samples for GET endpoints with required query params
  (Mintlify omits query params from generated snippets)
- Document 401 once in every spec's auth scheme description
- Correct wrong facts: workflow run detail returns inputs as a JSON
  string; DELETE /conversations requires a JSON body; audio-to-text
  accepts audio/{mp3,m4a,wav,amr,mpga} by MIME type; workflow log
  created_by_account filters by email; triggered_from values are
  app-run/webhook/schedule/plugin; stop endpoints' user semantics
  differ per app type
- Remove unreachable docs: phantom text_replace SSE event, annotation
  403, file preview endpoint in the workflow spec, invented
  score_threshold bounds
- Make upload user optional (DEFAULT-USER fallback), fix upload
  response example, add missing invalid_param error
- Declare text_to_speech.autoPlay in parameters responses (prose
  values, no response-field enums)

* fix: complete API reference audit for knowledge and completion specs

* feat: add API spec consolidation pipeline

Phase-1 of the API docs consolidation: tooling that merges the five per-app-type Service API specs into one openapi_service.json per language, with every divergence resolved explicitly in resolutions.json and rendering-preserving namespacing for mode-scoped schema families. Includes the audit lint and parity checks (lint taught the new language-prefixed href scheme), hand-merged mode-aware SSE documentation for POST /chat-messages in en/zh/ja, and the New Agent (Beta) virtual nav group with code-verified mode notes.

* feat: consolidate API reference into one spec per language

Emit {en,zh,ja}/api-reference/openapi_service.json (82 ops, 130 components) from the audit-fixed per-app-type specs; wire docs.json to them with explicit per-app-type endpoint lists, x-mint.href URLs (/{lang}/api-reference/{tag}/{summary} with shared English slugs for in-place language switching), 265 redirects covering the legacy en and CJK URLs, per-app-type overview pages including New Agent (Beta), and rewritten legacy API links in 21 MDX bodies. The old five specs per language stay as pipeline input; they are no longer rendered.

* fix: remove dead conversation_completed error from chat specs

ConversationCompletedError is never raised anywhere at the verified 1.15.0 ref (7a4252b3de): controllers catch it, but no service code raises it, so the documented 400 conversation_completed can never fire. Remove the bullet and example from the chat and chatflow /chat-messages docs in en/zh/ja. Found and adversarially confirmed during the New Agent (PR #836) verification; filed on the upstream bug list.

* feat: add membership matrix and restructure nav config

* feat: rename resource tags and update all references

* feat: stamp per-operation availability lines

* feat: wire three-group API navigation

* feat: add app-type page coverage lint

* docs: rewrite chatflow overview as app-type API guide

* docs: polish chatflow overview zh and ja wording

* docs: rewrite workflow overview as app-type API guide

* docs: align workflow overview details across languages

* docs: expand new agent overview into app-type API guide

* docs: use task-oriented heading on new agent overview

* docs: rewrite chatbot and agent overview as app-type API guide

* docs: rewrite text generator overview as app-type API guide

* docs: match end user link text to merged spec summary

* docs: rewrite knowledge overview as app-type API guide

* docs: move knowledge api guide into api reference

* docs: localize ui labels on knowledge overview

* docs: refresh pipeline readme for restructure modes

* docs: name app-type pages in the guides sidebar

* feat: rename zh completion messages tag to match resource framing

* docs: prototype endpoints-first layout on chatflow overview

* docs: correct detail accuracy on chatflow overview

* docs: move human input flow guide into api reference

Move the shared HITL API integration walkthrough from its six per-product
copies into {en,zh,ja}/api-reference/guides/human-input-flow as the first
task guide in the API docs. Guides gains an App Types subgroup (expanded
by default) with the flow guide after it; six redirects cover the old
paths; the Human Input node docs and the chatflow overview link to the
new home.

* fix: update spec links to the moved human input guide

* fix: let spec lint accept mdx guide pages under api-reference

* docs: align chatflow zh and ja overviews to endpoints-first layout

* docs: polish chatflow zh and ja mode terms and hitl wording

* docs: align workflow overviews to endpoints-first layout

* docs: document form expiry path in human input flow guide

* docs: align new agent overviews to endpoints-first layout

* docs: align chatbot and agent overviews to endpoints-first layout

* docs: align text generator overviews to endpoints-first layout

* docs: align knowledge overviews to endpoints-first layout

* docs: correct built-in metadata examples and agent heading

* docs: flatten app-type pages directly under guides

* docs: make guide pages self-contained and trim reference detail

* docs: add get started guide and retire developing-with-apis

* docs: update new agent api behavior for latest main

New Agent behavior re-verified against dify origin/main (f3ba2846):
agent_thought events now stream through the Service API carrying the
model's reasoning steps and tool calls; a new agent_not_published 400
fires on Send Chat Message and Get App Parameters; the files claim is
softened to contents-not-processed (raw references now reach the prompt;
runtime confirmation pending). Streaming-only, message_end metadata, and
the endpoint surface are unchanged.

* docs: audit fixes for get started and human input flow guides

* docs: fix em dash spacing and ja sentence length in get started

* docs: move message_end note to the send endpoint line

* docs: update writing guides and API skill for app-type naming

- Glossary and zh/ja translation guides: Workflow and Chatflow app types stay English (Workflow 应用 / Chatflow アプリ); lowercase workflow localizes to 工作流 / ワークフロー.
- formatting-guide: API reference links use the language prefix with English slugs.
- dify-docs-api-reference skill: Spec Structure documents source specs merged into openapi_service.json by the pipeline.

* feat: add operation sidebar titles and simplify API redirects

- merge_specs stamps x-mint.metadata.sidebarTitle per operation so translated summaries show in the sidebar.
- Redirects reduced to a catch-all to the English API home plus three knowledge-base exceptions.
- memberships, strings, and SSE overrides carry app-type labels (Workflow/Chatflow English, New Agent, API Overviews group).

* docs: correct app-type naming and translations across API specs

- English mode enum labels Chatflow and Workflow apps.
- zh/ja app references use Workflow/Chatflow; New Agent is 新 Agent / 新しい Agent.
- ja knowledge tag データセット becomes ナレッジベース; zh 模型提供商 becomes 模型供应商.
- Regenerate merged openapi_service.json with per-operation sidebar titles.

* docs: add streaming, errors, and end-user identity API guides

- Consume Streaming Responses: response modes, SSE parsing, event dispatch, and reconnect.
- Handle Errors and Rate Limits: the error envelope, status classes, and retry guidance.
- End User Identity: what the user field scopes and why it stays consistent.
- English source with zh and ja translations.

* docs: reconcile API guides and apply app-type naming

- Reader-test fixes and content audit on get-started and the app-type overview pages.
- zh/ja reconciled to the English source.
- Workflow/Chatflow and New Agent naming applied in prose.

* feat: wire API nav and redirects for consolidated guides

- Rename the guides group to API Overviews and register the new guide pages.
- Redirects: catch-all to the English API home plus three product-embedded knowledge-base links to the Knowledge guide.

* fix: normalize zh model-provider term to 模型供应商

Aligns the POSITION_PROVIDER_* descriptions with the canonical glossary term.

* docs: use Info callouts for guide forward-link notes

Wrap the authentication, base URL, and `user` field forward-reference in each app-type guide (agent, chat, chatflow, completion, workflow; en/zh/ja) in an `<Info>` callout.

* refactor: remove one-time analyze mode and verification compose

- Drop the `analyze` mode (design-time spec-overlap analysis) and its helpers; the merge is stable and nothing invokes it.
- Delete `compose.swagger.yml`, the throwaway local code-vs-spec verification stack (flagged in review for inline credentials).
- README: drop the analyze entry and correct the redirect description.

* fix: correct Chatflow naming and reasoning wording in SSE overrides

- Use "Chatflow" (English) for the app type in the `/chat-messages` SSE tables instead of 对话流/チャットフロー, and fix the legacy zh chatflow "对话流工作流" description. Standalone table cells were missed by the earlier app-type rename.
- Describe `reasoning_chunk` as "reasoning content" in en/ja (matching the `reasoning` field and the zh wording) instead of "chain-of-thought".

* docs: refine API guide wording and simplify the human-input example

* docs: standardize Workflow and Chatflow app-type capitalization

Capitalize Chatflow and Workflow when they name an app type; keep "workflow" lowercase for the general engine, graph, or run sense.

* fix: use 供应商 for model provider in the zh Knowledge spec

* fix: rename the Knowledge API nav group to "Knowledge APIs"

* fix: un-deprecate Update Document by Text in the Knowledge spec

* translate: un-deprecate Update Document by Text in zh/ja specs

Mirror the en fix (6802d5eb) into the zh and ja Knowledge specs, source and merged: drop the deprecated flag and the leading Deprecated notice from the update-by-text operation. It is the canonical text-update route; only Update Document by File stays deprecated.

* fix: repoint tools node links to the Classic Agent tab anchor

The Tool Configuration heading is now nested inside the Classic Agent tab, so #tool-configuration no longer resolves. Point the three Tools-page links (en/zh/ja) at the tab-title anchor instead.

* fix: correct broken bold and dropped text in ja/zh Agent node

Pre-existing classic-content translation flaws surfaced in review: the ja ReAct bold cycle was mangled and missing Thought; the zh Memory sentence had dropped text.

* docs: document New Agent deployment and 1.16.0-rc1 availability

Retire the sandbox-container placeholder. The availability Notes, the node-page Note, and a new environments "New Agent (Beta)" section now point to the Dify 1.16.0-rc1 release, note it's on by default on Docker Compose, and call out DIFY_AGENT_SERVER_SECRET_KEY as the one value to set. Also aligns the ja data-security Warning with the zh single-tenant wording. en/zh/ja.

* fix: relink publish API Integration card to the API reference (#847)

* docs: standardize workflow casing in key-concepts and environments

* translate: apply Workflow/Chatflow app-type naming to zh/ja docs

* translate: sync API-guide copy-edits to zh/ja

* fix: correct New Agent API guide against the current runtime

Verified against feat/agent-v2: the reply streams as agent_message events (not message), list-message agent_thoughts carries the turn's reasoning steps (not empty), uploaded files are surfaced to the agent as downloadable references (not ignored), and /meta tool_icons is empty for New Agent apps. Adds the 1.16.0-rc1 availability pointer to the beta note. en/zh/ja.

* docs: use Tip for New Agent availability callouts and tidy API guides

Switch the New Agent availability callouts (overview, build, node) from Note/Info to Tip; the node callout gains the on-by-default sentence. Tighten the API guide beta Info and restructure the get-started API-key section into bullets. zh/ja synced to the en edits.

* fix: point home page API Reference card at the new API guide

* fix: rename Agent nav references to Agents to match the UI

The main-nav item and its page are now labeled Agents (plural), rendered as a literal in routes.ts and roster/page.tsx. Update the bolded nav/page references across the New Agent guide, node page, and environment reference. en/zh/ja.

* fix: add one-hop developing-with-apis redirects for all URL forms

* fix: document both New Agent reply events in the streaming contract

The New Agent guide said replies stream as agent_message; the Send Chat Message SSE reference and the streaming guide said message. Verified against dify feat/agent-v2 (agent_app/app_runner.py and its unit tests): both fire — the reply streams incrementally as agent_message deltas, then the turn closes with a single message event carrying the complete answer, then message_end, with agent_thought alongside throughout. Document the full sequence on all three surfaces and tell clients to treat the closing message as the final answer rather than appending it. en/zh/ja; merged specs regenerated via the API pipeline (build + wire, coverage clean).

* fix: update New Agent env docs for the bundled development secret key (#849) (#850)

* fix: update New Agent secret key docs for the bundled development default

feat/agent-v2 now ships a valid development key for DIFY_AGENT_SERVER_SECRET_KEY in .env.example and the Compose fallback, so the backend starts out of the box; the old claim that an invalid placeholder blocks startup no longer holds. Reframe the entry around replacing the publicly known key before production, scope the startup failure to malformed values, and soften the guide callouts from a start prerequisite to production hardening. Replace the stale remaining-variables sentence with a table covering all 11 DIFY_AGENT_* plumbing vars, defaults verified against feat/agent-v2. en/zh/ja.

* chore: cover secret-value false positives in the env-var verifier

Add DIFY_AGENT_SERVER_SECRET_KEY to the ignored-vars false-positives bucket (docs describe the pre-filled development key instead of reproducing it) and refresh the stale ENABLE_AGENT_V2 entry, now superseded by NEXT_PUBLIC_ENABLE_AGENT_V2 and removed from .env.example on feat/agent-v2. Fix the verifier so the ignore list also applies to the default-mismatch check, which previously bypassed it.

(cherry picked from commit 63b392da48)

* fix: hedge the Dify Cloud edge-proxy timeout claim in the streaming guide (#851) (#852)

(cherry picked from commit c0664dacc5)

* docs: apply the ready-to-use vs custom knowledge rebrand to Cloud docs (#853) (#856)

* docs: apply the ready-to-use vs custom knowledge rebrand to Cloud docs

Cloud 1.15.0 ships the same KB creation redesign as CE 1.15.0: the two create entry points are now Create a ready-to-use knowledge base and Build a custom knowledge base, reached through Knowledge > Create. Mirror the self-host rename (305e3f9f) onto the Cloud knowledge pages in all three languages: nav group labels, page titles, create paths, and name-tied prose, plus the bridge from the custom knowledge base page to the knowledge pipeline. Remove the outdated create-entry screenshot, now unreferenced.

* fix: correct list numbering and blank lines in self-host knowledge pages

Fix leftovers from the self-host knowledge creation rename: the zh integrate-knowledge page had two list items numbered 7, and the zh/ja create-knowledge-pipeline pages kept a double blank line where the screenshot Frame was removed.

* fix: correct grammar and formatting flagged in PR #853 review

Address Copilot review feedback, applying each fix to both the cloud and self-host copies to keep the trees in sync: replace "There're" with "There are", fix "one of the knowledge base created", rewrite the comma splice on the custom knowledge base overview, add the missing space before bold Chinese text, and strip trailing whitespace from the create-entry bullets.

(cherry picked from commit 476c02b9d7)

* feat: finish API reference Phase 1: code audit and readability overhaul (#857) (#858)

* feat: retire the merge pipeline and delete the legacy source specs

openapi_service.json is now the spec of record per language, edited directly. The build/relink modes, resolutions.json, and overrides/ that consolidated the five per-app-type specs are recoverable from git history when Phase 2 rebuilds the spec from the upstream-generated source.

* fix: make parity_check exit nonzero on failures

* docs: document the direct-edit spec workflow in skills and translation guides

* fix: correct the Service API reference against the code-verified audit

Applies the confirmed findings of a full per-operation audit against dify 3c8e0e2113 / graphon 0.6.0: 9 factual errors (availability lines, phantom fields, wrong enum values, inert parameters, wrong error messages), ~33 omitted-error and example-accuracy gaps, the rate_limit_error recharacterization, provider-identifier format documentation, and New Agent availability on the endpoints its Chat Features support (verified end-to-end in code).

* docs: document New Agent's full endpoint surface in the API guides

* translate: propagate the Service API audit fixes to zh and ja

* docs: rewrite Upload File as the readability pilot

Worked example of the API readability standard: contract-first description, facts on the fields (category size limits with env-var link, blacklist rule), real error triggers (415 corrected to its actual cause), template user sentence, source links on sourceable values, and a hand-written multipart cURL sample. Applied to en/zh/ja.

* docs: update spec-conventions for the live link scheme and code samples

* docs: apply the readability standard across the Service API reference

Rewrites all 82 operations to the agreed standard in en/zh/ja: contract-first descriptions, facts on the fields, trigger-led error bullets, template sentences (user, pagination, provider identifiers), source links on sourceable values, guide links instead of inline concept re-explanations, cURL samples where the playground autogen fails (multipart, SSE), a paragraph ceiling everywhere, and restructured streaming narratives (events-by-app-type map; details stay in the event tables). Also folds in two fact corrections surfaced during review: the legacy securitySchemes text and the stale Cloudflare-timeout claim in response_mode, now using the hedged edge-proxy wording.

* docs: codify the readability standard and audit method in the API skill

* fix: apply the audit-verified corrections deferred from the readability pass

Small factual items evidenced in the audit findings that the readability pass could not touch under its fact-freeze: real wire messages (audio 413, type_mismatch number, dynamic run-by-id 404, werkzeug 500/403 strings, annotation 404 punctuation), schema precision (format: uuid, minimum: 1, six missing Get Available Models response fields), and behavioral completeness (document download/zip/delete 404 message variants, tag_ids silent-ignore note, request-scoped batch-metadata lock wording, reasoning_chunk message_id: null, form default key absent not null). Applied to en/zh/ja; parity 0.

* fix: make spec checkers target openapi_service.json explicitly

After the legacy specs were deleted, the openapi_*.json globs in parity_check and lint_specs would silently pass (match nothing, report 0 issues, exit 0) if the spec of record went missing, and would pick up unintended future openapi_*.json files. Both now name openapi_service.json per language and exit 1 when it is absent.

* fix: address Copilot review on pipeline tooling and example titles

Normalizes example summary separators to the dominant "Request Example - Mode" form (the convention doc had drifted, and 4 em-dash outliers existed per language); lint_specs no longer re-reads the spec it already loaded; all spec reads use explicit UTF-8; coverage_matrix and swagger_diff target openapi_service.json explicitly; README and docstring usage resolve DOCS from the git root so the commands work from any directory.

* fix: use context managers for all pipeline file reads

Copilot flagged unclosed handles in the three checkers; applied consistently across all five pipeline scripts (merge_specs and coverage_matrix had the same pattern unflagged).

* fix: report missing spec ops as coverage failures instead of crashing

* fix: print the full relative path in the parity missing-file message

(cherry picked from commit 6aa0ae4661)

* feat: retire the auto-translation pipeline (#854) (#859)

* feat: retire the auto-translation pipeline

* fix: drop the Dify-API translator and align the navigation guideline

* fix: remove unused pipeline-era config and the translation A/B test framework

* fix: retire remaining pipeline references in glossary, env-vars skill, termbase tool

(cherry picked from commit 267089b359)

* fix: converge drifted content between the cloud and self-host trees (#862) (#864)

* fix: converge drifted content between the cloud and self-host trees

Eight pairs had real drift (missed cross-tree syncs, mostly #820's
cleanup never carried to cloud): Introduction-heading removals and
webhook rewording, the 1.15.0 integrations rename, a missing #mcp
anchor, utilize->use, apostrophe and ja terminology/spacing alignment.
After this, every mapped pair differs only in deliberate
audience-specific content.

* fix: plan-gating callouts — add conjunctions, align zh with en, drop audience restatements

(cherry picked from commit 5575764827)

* fix: repair MT-corrupted sentences in the webapp guides (zh/ja) (#866) (#868)

Five passages from the revamp-era MT batch had dropped spans or truncated sentences (workflow-webapp and chatflow-webapp, both audience trees). Each is retranslated from the current en source; everything else in the publish/webapp family verified clean against en.

(cherry picked from commit 51be4e7cae)

* fix: align reverse invocation App signatures with the plugin SDK (#873) (#875)

The Reverse Invocation App page documented App invocation signatures that predate the removal of the top-level `files` argument, so every documented signature, and the Chat example, failed against current Python SDK releases (verified against v0.9.1).

Corrected across the English, Chinese, and Japanese pages: drop the removed `files` argument from the Chat, Workflow, and Completion signatures; add the required `query` argument to Chat and to the Chat example; mark `conversation_id` optional; add the optional `user` argument; and show the `response_mode` defaults (`streaming` for Chat, `blocking` for Workflow and Completion). Signatures now match the SDK runtime definitions.

Closes #872
Closes DC-27

(cherry picked from commit 2975506628)

* docs: rewrite Go to Anything for 1.16.0 (Feature Preview commands, entry points, scopes)

Full rewrite against the GA code: sidebar search button + shortcut as entry points, recents, the @ scopes with @node's pipeline-editor support, and a complete slash-command table including the Feature Preview /create and /refine (with aliases in the Command column). UI-discoverable mechanics deliberately omitted. en/zh/ja.

* docs: wire Snippets and Go to Anything into the self-host nav

Both pages existed without navigation entries. Snippets lands before Workflow Collaboration in the Workflow & Chatflow group; Go to Anything before Shortcut Key. All three language sections.

* docs: update the env reference for 1.16.0

Add NEXT_PUBLIC_ENABLE_FEATURE_PREVIEW (default true, gates /create and /refine), API_WEBSOCKET_WORKER_AMOUNT (completing the websocket group), and the four REDIS_KEEPALIVE* vars (verified against ext_redis.py). The New Agent section drops its rc1 deploy pointer for GA. en/zh/ja; verifier reports 0 mismatches.

* docs: add the Snippets feature guide

Reusable node groups: the three creation paths, editor restrictions, draft/publish model, published-version insertion, and the CE permissions table. Verified against GA code including the #38134 RBAC change (inert on CE). en/zh/ja.

* docs: update difyctl docs for the 1.16.0 version gate and --insecure TLS skip

The four compatibility verdicts with their rendered labels, exit-6 enforcement incl. HTTP 426, the 1-hour compat cache, login-time checking, and --insecure extending to self-signed/invalid TLS certs. Every claim traced to cli/src at the GA ref. en/zh/ja.

* docs: port 1.16.0 feature updates to the affected guides

MCP dynamic request headers with Custom Headers/Timeouts subheadings (tools.mdx, which also gains New Agent apps in its use-tools list), the web app input placeholder (64 chars, chat-style apps), a simplified Doc Extractor PDF line, and the docker compose container list gaining agent_backend and local_sandbox. en/zh/ja.

* docs: retire the rc1 deploy pointers for GA

The New Agent callouts, node page, and API guide told readers to deploy the 1.16.0-rc1 pre-release; at GA the version note is redundant on a versioned release branch. Beta framing stays. en/zh/ja.

* docs: document the workflow-version 403 and speech_to_text_disabled API errors

Sandbox-plan gating of pinned-version execution (dify #38662, #38892) lands as a 403 on Run Workflow by ID and Send Chat Message, with the paid-plan note on the Cloud version-control page (restore/DSL-export gating UI-verified). The audio-to-text 400 replaces the stale invalid_param bullet with speech_to_text_disabled (#38653). en/zh/ja.

* docs: address review feedback after merging main

Name the Normal role explicitly in the snippet permissions note (en, matching zh/ja), and split an over-long ja sentence introduced by the GA trim.

* fix: use the spec's ASCII colon separator in the speech_to_text_disabled bullets

The zh/ja error lists separate code from description with ' : ' throughout; the new bullet used a full-width colon. Copilot review on #848.

* docs: fix a garden-path sentence and mirror the Doc Extractor simplification to Cloud

The MCP custom-headers fallback sentence parsed 'runs' as a verb; rephrased as an explicit conditional. The Cloud doc-extractor copies keep parity with self-host by dropping the pypdfium2 mechanism mention (same implementation both products). Copilot review on #848.

* docs: document SHELLCTL_ENABLE_PATH_ISOLATION for the agent sandbox

* docs: note that discarding a build draft leaves sandbox changes intact

* docs: move the discard caveat into a Note callout

* fix: restore localized Human Input sample strings in zh/ja specs

* chore: drop stale env ignore-list entries superseded by 1.16.0 docs

* docs: state why .env cannot set the sandbox isolation toggle

* docs: document seven new 1.16.0 env vars (agent stream, redaction, new-user defaults, workflow generation)
2026-07-17 19:33:25 +08:00

546 lines
28 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: アプリ
description: Dify アプリをコマンドラインから一覧表示、確認、実行、再開、エクスポート、インポート
---
> このドキュメントは AI によって自動翻訳されています。不正確な部分がある場合は、[英語版](/en/cli/reference/apps) を参照してください。
各アプリ操作は 1 つのコマンドに対応し、いずれも [グローバルフラグ](/ja/cli/reference/global-flags) を受け付けます。
- [`difyctl get app`](#アプリを一覧表示) はアプリを一覧表示します
- [`describe app`](#アプリを確認) は単一アプリの詳細と入力を表示します
- [`run app`](#アプリを実行) は単一アプリを呼び出します
- [`resume app`](#一時停止したワークフローを再開) は [人間の入力で一時停止した](#ワークフローが一時停止する場合) ワークフローを継続します
- [`export studio-app`](#アプリをエクスポート) / [`import studio-app`](#アプリをインポート) はアプリを DSL ファイルとしてエクスポート / インポートします
## アプリを一覧表示
```text
difyctl get app [app-id] [flags]
```
<Tip>
日常的な呼び出し方法は、[よくあるタスク](/ja/cli/common-tasks) の [アプリの検索](/ja/cli/common-tasks#アプリの検索) を参照してください。
</Tip>
### 引数
- `[app-id]`:任意。表示する単一アプリの ID。省略すると、ワークスペース内のすべてのアプリを一覧表示します。
### フラグ
| フラグ | 型 | デフォルト | 説明 |
|:---|:---|:---|:---|
| `--name <substring>` | string | なし | 名前にこのテキストを含むアプリのみに絞り込みます。 |
| `--mode <mode>` | string | なし | アプリタイプで絞り込みます。API mode で指定します: <ul><li>`chat`(チャットボット)</li><li>`advanced-chat`Chatflow</li><li>`agent-chat`Agent</li><li>`workflow`Workflow</li><li>`completion`(テキストジェネレーター)</li></ul> |
| `--page <n>` | integer | `1` | ページ番号。 |
| `--limit <n>` | integer | `20` | ページサイズ、1 から 200。フラグが優先され、次に [`DIFY_LIMIT`](/ja/cli/reference/environment-variables) が使われます。 |
| `--workspace <id>` <Badge color="blue" size="sm">Cloud</Badge> | string | アクティブなワークスペース | この呼び出しに限り別のワークスペースに対して実行します。<br></br><br></br>`difyctl` がワークスペースを解決する方法は、[difyctl がワークスペースを選択する仕組み](/ja/cli/reference/workspaces#difyctl-がワークスペースを選択する仕組み) を参照してください。 |
| `-A, --all-workspaces` <Badge color="blue" size="sm">Cloud</Badge> | boolean | `false` | token で参照できるすべてのワークスペースのアプリを一覧表示します。 |
| `-o <format>` | string | なし | 出力形式: `json`、`yaml`、`name`、`wide`。フラグを省略するとデフォルトのテーブルになります。 |
### 例
ワークスペース内のアプリを一覧表示します:
```bash
difyctl get app
```
所属するすべてのワークスペースのアプリを一覧表示します:
```bash
difyctl get app -A
```
名前に「report」を含む Workflow アプリを検索します:
```bash
difyctl get app --name report --mode workflow
```
アプリ ID のみを 1 行に 1 つ出力し、shell ループで使います:
```bash
difyctl get app -o name
```
### 出力
| 形式 | stdout の内容 |
|:---|:---|
| デフォルト | 整列されたテーブル。`MODE` 列は各アプリの API mode 名です(アプリタイプとの対応は [`--mode`](#アプリを一覧表示) を参照)。 |
| `-o wide` | テーブルに `WORKSPACE` 列を加えたもの。 |
| `-o json`、`-o yaml` | アプリの `data` 配列に加え、ページング項目の `page`(現在のページ)、`limit`(ページサイズ)、`total`(一致したアプリ数)、`has_more`(さらにページがあるか)。 |
| `-o name` | アプリ ID を 1 行に 1 つ。 |
デフォルトのテーブル:
```text
NAME ID MODE UPDATED
Customer FAQ 0a1b2c3d-4e5f-6789-abcd-ef0123456789 chat 2026-06-08T03:14:27.521839
Daily Report 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b workflow 2026-06-05T22:41:09.812016
```
### 終了コード
| 終了コード | 意味 |
|:---|:---|
| `0` | 成功 |
| `1` | ネットワークまたはサーバーエラー |
| `2` | 使用方法のエラー(例: `--limit` が 1 から 200 の範囲外) |
| `4` | 認証失敗 |
| `7` | レート制限(HTTP 429 |
全体の体系は [出力形式と終了コード](/ja/cli/reference/output-formats-and-exit-codes) を参照してください。
## アプリを確認
```text
difyctl describe app <app-id> [flags]
```
`describe app` は、よく知らないアプリを実行する前に確認したいこと、つまりアプリのタイプ、API が有効かどうか、どんな入力が必要かを教えてくれます。
### 引数
- `<app-id>`:必須。確認するアプリの ID。
### フラグ
| フラグ | 型 | デフォルト | 説明 |
|:---|:---|:---|:---|
| `--refresh` | boolean | `false` | ローカルのアプリ情報キャッシュをバイパスし、最新の詳細を取得します。アプリの再公開後に使用します。 |
| `-o <format>` | string | `text` | 出力形式: `json`、`yaml`、`text`。 |
### 例
実行前にアプリを確認します:
```bash
difyctl describe app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b
```
`--inputs` をプログラムで組み立てるために入力スキーマを抽出します:
```bash
difyctl describe app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b -o json | jq '.input_schema'
```
アプリの再公開後に再取得します:
```bash
difyctl describe app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b --refresh
```
### 出力
| 形式 | stdout の内容 |
|:---|:---|
| デフォルト(`text`) | 整列されたフィールドブロックに続いて、アプリのパラメータ(ユーザー入力フォームを含む)。 |
| `-o json`、`-o yaml` | 3 つのトップレベルキー: `info`、`parameters`、`input_schema`(詳細は後述)。 |
デフォルトのテキストビュー:
```text
Name: Daily Report
ID: 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b
Mode: workflow
Updated: 2026-06-05T22:41:09.812016
Service API: true
Parameters:
{
"opening_statement": null,
"suggested_questions": [],
"user_input_form": [
{
"text-input": {
"label": "topic",
"variable": "topic",
"required": true,
"default": ""
}
}
],
"file_upload": null,
"system_parameters": {
"file_size_limit": 15,
"image_file_size_limit": 10,
"audio_file_size_limit": 50,
"video_file_size_limit": 100,
"workflow_file_upload_limit": 10
}
}
```
アプリに説明がある場合は `Description:` 行が、アプリが agentic な場合は `Agent: true` 行が表示されます。
`-o json` では、3 つのキーはそれぞれ次のとおりです:
- `info`:上記の `Name` から `Service API` までのメタデータ項目
- `parameters`:上記のパラメータブロック
- `input_schema`:アプリ入力の正規化されたリスト。`jq '.input_schema'` の例が読み取る項目
### 終了コード
| 終了コード | 意味 |
|:---|:---|
| `0` | 成功 |
| `1` | ネットワークまたはサーバーエラー(アプリが見つからない場合を含む) |
| `2` | 使用方法のエラー(`<app-id>` が UUID でない場合を含む) |
| `4` | 認証失敗 |
| `7` | レート制限(HTTP 429 |
## アプリを実行
```text
difyctl run app <app-id> [message] [flags]
```
`run app` は、すべてのアプリタイプを 1 つのコマンドで扱います。CLI がアプリのタイプを判別し、適切なエンドポイントに振り分けます。アプリタイプによって変わるのは、入力の渡し方とレスポンスの形だけです:
- **チャットボット、Chatflow、Agent**:位置引数のメッセージを受け取り、応答を stdout に出力し、会話のヒントを stderr に出力します。
- **テキストジェネレーター**:位置引数のメッセージを受け取り、補完結果を stdout に出力します。会話状態もヒントもありません。
- **ワークフロー**`--inputs` で JSON オブジェクトを受け取り、その出力を stdout に出力します。出力が単一の文字列のときはそのまま、それ以外はコンパクトな JSON として出力します。
### 引数
- `<app-id>`:必須。実行するアプリの ID。[`get app`](#アプリを一覧表示) から取得します。
- `[message]`:ユーザーメッセージ。チャットボット、Chatflow、Agent、テキストジェネレーターのアプリで使います。Workflow アプリは位置引数のメッセージを受け付けないため、その入力は `--inputs` で渡します。
### フラグ
| フラグ | 型 | デフォルト | 説明 |
|:---|:---|:---|:---|
| `--inputs <json>` | string | なし | 入力変数を 1 つの JSON オブジェクトとして指定します。例: `--inputs '{"topic":"Q3"}'`。Workflow アプリでは必須です。`--inputs-file` とは併用できません。 |
| `--inputs-file <path>` | string | なし | 代わりに JSON ファイルから入力オブジェクトを読み込みます。 |
| `--file <key=value>` | string、繰り返し可 | なし | 名前付きファイル入力。`key=@path` はローカルファイルをアップロードします。`key=https://…` はアップロードせずにリモート URL を渡します。key は入力変数名です。 |
| `--conversation <id>` | string | なし | 既存の会話を継続します。ID は前回の実行の stderr ヒントまたは JSON レスポンスから得られます。 |
| `--workflow-id <id>` | string | なし | 実行を特定の公開済みワークフローバージョンに固定します。Workflow と Chatflow のアプリのみ。 |
| `--stream` | boolean | `false` | 最後に一度に出力するのではなく、生成されるそばから出力をライブで表示します。 |
| `--think` | boolean | `false` | モデルが思考過程を公開する場合に、インラインの `<think>` ブロックまたは独立した推論ストリームとして stderr に出力します。<br></br><br></br>このフラグがない場合、その思考は表示されません。 |
| `--retry-on-limit` | boolean | `false` | 429 レート制限時に、終了コード `7` で失敗する代わりに待機して実行を再試行します。実行は冪等ではないため、デフォルトはオフです。 |
| `--workspace <id>` <Badge color="blue" size="sm">Cloud</Badge> | string | アクティブなワークスペース | この呼び出しに限り別のワークスペースに対して実行します。<br></br><br></br>`difyctl` がワークスペースを解決する方法は、[difyctl がワークスペースを選択する仕組み](/ja/cli/reference/workspaces#difyctl-がワークスペースを選択する仕組み) を参照してください。 |
| `-o <format>` | string | `text` | 出力形式: `json`、`yaml`、`text`。 |
### 例
チャットボット、Chatflow、Agent、テキストジェネレーターのアプリにメッセージを送信します:
```bash
difyctl run app 0a1b2c3d-4e5f-6789-abcd-ef0123456789 "What are your business hours?"
```
構造化された入力で Workflow アプリを実行します:
```bash
difyctl run app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b --inputs '{"topic":"quarterly report","audience":"executives"}'
```
ファイル型の入力変数にローカルファイルを添付します:
```bash
difyctl run app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b --inputs '{"topic":"contract review"}' --file document=@./contract.pdf
```
以前の会話を継続します:
```bash
difyctl run app 0a1b2c3d-4e5f-6789-abcd-ef0123456789 "And on weekends?" --conversation 4f7d8c2a-9b1e-4c6d-8a3f-5e2b7c9d0a1f
```
スクリプトやエージェント向けに、生のレスポンスを JSON で取得します:
```bash
difyctl run app 0a1b2c3d-4e5f-6789-abcd-ef0123456789 "What are your business hours?" -o json | jq -r '.answer'
```
### 出力
| 形式 | stdout の内容 |
|:---|:---|
| デフォルト(`text`) | 応答(チャットボット、Chatflow、Agent、テキストジェネレーター)またはワークフローの出力を、プレーンテキストで。 |
| `-o json`、`-o yaml` | サーバーの完全なペイロード。会話型アプリでは `answer` と `conversation_id` を含みます。モデルが推論を返す場合は、推論が `metadata.reasoning` の下に含まれます。 |
レスポンス本体は stdout に出力されます。それ以外(ヒント、進捗、エラー)はすべて stderr に回るため、パイプやリダイレクトの出力が汚れません。チャットボット、Chatflow、Agent のアプリでは、応答に続けて会話のヒントが stderr に出力されます:
```text
hint: continue this conversation with --conversation 4f7d8c2a-9b1e-4c6d-8a3f-5e2b7c9d0a1f
```
`--stream` を付けると、サーバーが生成するそばから出力が逐次表示されます。アプリの再公開直後に実行が HTTP 422 で失敗した場合、CLI はアプリメタデータのキャッシュをクリアし、コマンドの再実行を促します。
エラーは stderr に出力されます。`-o json` では、安定した `code` 項目を持つ構造化された JSON オブジェクトとして返されます。エラーの形は [出力形式と終了コード](/ja/cli/reference/output-formats-and-exit-codes) を参照してください。
### 終了コード
| 終了コード | 意味 |
|:---|:---|
| `0` | 成功。[人間の入力で一時停止した](#ワークフローが一時停止する場合) ワークフローを含む |
| `1` | ネットワークまたはサーバーエラー(アプリが見つからない場合を含む) |
| `2` | 使用方法のエラー: `--inputs` の JSON が無効、または Workflow アプリに位置引数のメッセージを渡した場合 |
| `4` | 認証失敗 |
| `7` | レート制限(HTTP 429 |
### ワークフローが一時停止する場合
Workflow と Chatflow のアプリには人間の入力ステップを含められます。実行がそこに到達すると、終了せずに一時停止します。コマンドは **終了コード 0 で終了し**(一時停止は失敗ではありません)、一時停止を stdout に出力し、すぐに実行できる再開コマンドを stderr に出力します:
```text
! Workflow paused — input required
Node: Review draft
Message: Approve the report before it is published.
Actions: [approve] Approve [reject] Reject
Inputs: - comment — Reviewer comment
! workflow paused — resume with:
difyctl resume app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b k3J9mQ2xWv8pL5nR7tY4bA --workflow-run-id 8e1f2a3b-4c5d-6e7f-8a9b-0c1d2e3f4a5b --action approve
```
`-o json` を付けると、stdout には一時停止が JSON オブジェクトとして出力されます:
```json
{
"status": "paused",
"app_id": "7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b",
"task_id": "c4a8e2f6-1b3d-4a5c-9e7f-2d8b6c0a4e1f",
"workflow_run_id": "8e1f2a3b-4c5d-6e7f-8a9b-0c1d2e3f4a5b",
"form_id": "5d9c3b7a-2e4f-4c6d-8b0a-1f3e5d7c9b2a",
"node_id": "1749876543210",
"node_title": "Review draft",
"form_token": "k3J9mQ2xWv8pL5nR7tY4bA",
"form_content": "Approve the report before it is published.",
"inputs": [
{
"output_variable_name": "comment",
"label": "Reviewer comment",
"type": "text-input",
"required": false
}
],
"actions": [
{ "id": "approve", "title": "Approve" },
{ "id": "reject", "title": "Reject" }
],
"display_in_ui": true,
"resolved_default_values": {},
"expiration_time": 1781712000
}
```
スクリプトやエージェント向け: 一時停止した実行も完了した実行もどちらも終了コード 0 のため、終了コードで分岐しないでください。ワークフローは `-o json` で実行し、stdout に `"status": "paused"` があるか確認します。再開に必要なのは次の 3 つです: `form_token`、`workflow_run_id`、そして(フォームが複数の操作を提示する場合は)操作の `id`。フォームは `expiration_time`Unix エポック秒)の時点で期限切れになります。
ワークフローがメールやその他の外部チャネル経由でフォームを配信する場合、`form_token` は `null` になり、その実行は CLI から再開できません。
## 一時停止したワークフローを再開
```text
difyctl resume app <app-id> <form-token> --workflow-run-id <id> [flags]
```
`resume app` は、一時停止したワークフローが待機しているフォームを送信し、その実行にアタッチして、`run app` とまったく同じように出力を表示します。
### 引数
- `<app-id>`:必須。一時停止ペイロードの `app_id`。
- `<form-token>`:必須。一時停止ペイロードの `form_token`。Token は 1 回限りのため、消費済みの token で再開するとエラーが返ります。
### フラグ
| フラグ | 型 | デフォルト | 説明 |
|:---|:---|:---|:---|
| `--workflow-run-id <id>` | string | 必須 | 一時停止ペイロードの `workflow_run_id`。 |
| `--action <id>` | string | 自動選択 | どのフォーム操作を実行するか。一時停止ペイロードの `actions` 内の `id` で指定します。<br></br><br></br>フォームの操作がちょうど 1 つの場合は任意、複数ある場合は必須です。 |
| `--inputs <json>` | string | なし | フォーム入力の値を 1 つの JSON オブジェクトとして、各入力の `output_variable_name` をキーにして指定します。<br></br><br></br>`--inputs-file` とは併用できません。 |
| `--inputs-file <path>` | string | なし | 代わりに JSON ファイルからフォームの値を読み込みます。 |
| `--with-history` | boolean | `false` | ライブストリームにアタッチする前に、実行済みノードの出力を再生します。 |
| `--stream` | boolean | `false` | 最後に一度に出力するのではなく、生成されるそばから出力をライブで表示します。 |
| `--think` | boolean | `false` | モデルが思考過程を公開する場合に、インラインの `<think>` ブロックまたは独立した推論ストリームとして stderr に出力します。<br></br><br></br>このフラグがない場合、その思考は表示されません。 |
| `-o <format>` | string | `text` | 出力形式: `json`、`yaml`、`text`。 |
### 例
単一操作のフォームを承認し、その入力値を指定します:
```bash
difyctl resume app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b k3J9mQ2xWv8pL5nR7tY4bA --workflow-run-id 8e1f2a3b-4c5d-6e7f-8a9b-0c1d2e3f4a5b --inputs '{"comment":"Looks good"}'
```
フォームが複数の操作を提示する場合に、操作を選びます:
```bash
difyctl resume app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b k3J9mQ2xWv8pL5nR7tY4bA --workflow-run-id 8e1f2a3b-4c5d-6e7f-8a9b-0c1d2e3f4a5b --action reject --inputs '{"comment":"Numbers need a re-check"}'
```
ファイルからフォームの値を読み込みます:
```bash
difyctl resume app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b k3J9mQ2xWv8pL5nR7tY4bA --workflow-run-id 8e1f2a3b-4c5d-6e7f-8a9b-0c1d2e3f4a5b --inputs-file form.json
```
### 出力
| 形式 | stdout の内容 |
|:---|:---|
| デフォルト(`text`) | 実行の進行に合わせて出力されるワークフローの出力。stderr が送信と完了を確認します。 |
| `-o json`、`-o yaml` | 実行結果を 1 つのドキュメントとして。`run app` と同じです(再び一時停止した場合は一時停止ペイロード)。 |
デフォルトのテキスト出力では、まず stderr が送信を確認し、実行の進行に合わせてワークフローの出力が stdout に出力され、最後に stderr が完了を確認します:
```text
✓ form submitted
workflow execution resumed
✓ workflow finished
```
再開したワークフローは、後続の人間の入力ノードで再び一時停止することがあります。その場合は新しい一時停止ペイロードを受け取り、新しい token で再び再開します。
### 終了コード
| 終了コード | 意味 |
|:---|:---|
| `0` | 成功。後続のノードで実行が再び一時停止する場合を含む |
| `1` | エラー。消費済みのフォーム token、または操作が複数あるフォームで `--action` を省略した場合を含む |
| `2` | 使用方法のエラー |
| `4` | 認証失敗 |
| `7` | レート制限(HTTP 429 |
## アプリをエクスポート
```text
difyctl export studio-app <app-id> [flags]
```
`export studio-app` は、バージョン管理、バックアップ、または別の場所への [インポート](#アプリをインポート) のために、アプリの完全な定義を DSL YAML ドキュメントとして書き出します。
Workflow と Chatflow のアプリでは、エクスポートは `run app` が実行する公開済みバージョンではなく、現在のドラフトを返します。代わりに `--workflow-id` を使うと、特定の公開済みバージョンをエクスポートできます。チャットボット、Agent、テキストジェネレーターのアプリは公開済みバージョンをエクスポートします。
### 引数
- `<app-id>`:必須。エクスポートするアプリの ID。[`get app`](#アプリを一覧表示) から取得します。
### フラグ
| フラグ | 型 | デフォルト | 説明 |
|:---|:---|:---|:---|
| `-o, --output <path>` | string | なし | DSL を stdout ではなくこのファイルに書き込みます。<br></br><br></br>このコマンドでは、`-o` は出力形式のセレクタではなく出力ファイルのパスです。 |
| `--include-secret` | boolean | `false` | エクスポートする DSL に暗号化された機密値を含めます。 |
| `--workflow-id <id>` | string | なし | デフォルトのドラフトではなく、特定の公開済みワークフローバージョンを ID で指定してエクスポートします。<br></br><br></br>Workflow と Chatflow のアプリのみ。 |
| `--workspace <id>` <Badge color="blue" size="sm">Cloud</Badge> | string | アクティブなワークスペース | この呼び出しに限り別のワークスペースに対して実行します。<br></br><br></br>`difyctl` がワークスペースを解決する方法は、[difyctl がワークスペースを選択する仕組み](/ja/cli/reference/workspaces#difyctl-がワークスペースを選択する仕組み) を参照してください。 |
### 例
アプリの DSL を stdout に出力します:
```bash
difyctl export studio-app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b
```
ファイルに書き込みます:
```bash
difyctl export studio-app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b --output ./daily-report.yaml
```
特定の公開済みバージョンをエクスポートします:
```bash
difyctl export studio-app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b --workflow-id c7e4a1b9-3f82-4d6a-9e15-0b8c2d7f4a63
```
機密値を含めてエクスポートします:
```bash
difyctl export studio-app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b --include-secret
```
### 出力
DSL YAML ドキュメントが stdout に出力されます: `kind: app` ヘッダー、`version` 項目、そしてアプリの完全な定義です。`--output` を付けると、同じ内容がファイルに書き込まれ、stderr が確認します:
```text
DSL written to ./daily-report.yaml
```
### 終了コード
| 終了コード | 意味 |
|:---|:---|
| `0` | 成功 |
| `1` | ネットワークまたはサーバーエラー(アプリが見つからない場合を含む) |
| `2` | 使用方法のエラー(`<app-id>` の欠落を含む) |
| `4` | 認証失敗 |
| `7` | レート制限(HTTP 429 |
## アプリをインポート
```text
difyctl import studio-app (--from-file <path> | --from-url <url>) [flags]
```
`import studio-app` は、DSL YAML ドキュメントからアプリを作成するか、`--app-id` で既存のアプリを上書きします。
Workflow と Chatflow のアプリでは、定義をアプリのドラフトに書き込みます。`run app` は公開済みバージョンを使うため、変更を反映させるにはインポート後に Dify でアプリを公開してください。
### フラグ
| フラグ | 型 | デフォルト | 説明 |
|:---|:---|:---|:---|
| `-f, --from-file <path>` | string | なし | ローカルファイルから DSL をインポートします。`--from-file` と `--from-url` のどちらか一方が必須です。 |
| `--from-url <url>` | string | なし | HTTP(S) URL から DSL をインポートします。 |
| `--name <name>` | string | DSL から | アプリ名を上書きします。 |
| `--description <text>` | string | DSL から | アプリの説明を上書きします。 |
| `--app-id <id>` | string | なし | 新規作成ではなく、既存のアプリを上書きします。<br></br><br></br>Workflow と Chatflow のアプリのみ。 |
| `--icon-type <type>` | string | DSL から | アイコンタイプを上書きします。 |
| `--icon <icon>` | string | DSL から | アイコンを上書きします。 |
| `--icon-background <color>` | string | DSL から | アイコンの背景色を上書きします。 |
| `--workspace <id>` <Badge color="blue" size="sm">Cloud</Badge> | string | アクティブなワークスペース | この呼び出しに限り別のワークスペースにインポートします。<br></br><br></br>`difyctl` がワークスペースを解決する方法は、[difyctl がワークスペースを選択する仕組み](/ja/cli/reference/workspaces#difyctl-がワークスペースを選択する仕組み) を参照してください。 |
### 例
ローカルの DSL ファイルからアプリをインポートします:
```bash
difyctl import studio-app --from-file ./daily-report.yaml
```
別の名前でインポートします:
```bash
difyctl import studio-app --from-file ./daily-report.yaml --name "Daily Report (staging)"
```
更新した DSL で既存のアプリを上書きします:
```bash
difyctl import studio-app --from-file ./daily-report.yaml --app-id 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b
```
URL から直接インポートします:
```bash
difyctl import studio-app --from-url https://example.com/templates/daily-report.yaml
```
### 出力
すべてのステータス行は stderr に出力され、stdout は空のままです。成功すると、stderr が新しいアプリの ID を報告します:
```text
Import completed: app 9b4f2c8e-6a1d-4e3f-b7a5-0c8d2e6f4a9b
```
DSL が別の DSL バージョン向けに書かれていた場合、CLI がそれを確認し、両方のバージョンを stderr に記載します。
アプリがワークスペースに未インストールのプラグインに依存している場合、インポート後に stderr が `Missing plugin dependencies` の下にそれらを列挙します。アプリを使う前にインストールしてください。
### 終了コード
| 終了コード | 意味 |
|:---|:---|
| `0` | 成功。警告付きのインポートを含む |
| `1` | エラー。`--from-file`/`--from-url` の欠落や競合、またはインポートの失敗を含む |
| `2` | 使用方法のエラー。存在しない `--from-file` パスを含む |
| `4` | 認証失敗 |
| `7` | レート制限(HTTP 429 |