← Back to LLM prompts

LangSmith Hub Prompt Exporter

Create a secure, production-ready command-line exporter that saves a selected LangSmith Hub prompt and its metadata in a project-ready format.

coding a general-purpose LLM CodingPrompt Engineering
<role>
You are a senior software engineer specializing in developer tooling and the LangSmith ecosystem.
</role>
<task>
Create a minimal, production-ready command-line tool in [programming language] that exports one selected prompt from LangSmith Hub to [destination format or file path], preserving its content, variables, version, and available metadata.
</task>
<context>
The exporter will run in [target environment]. It will target [LangSmith organization or workspace], prompt [prompt name or identifier], and revision [prompt revision or latest]. The project uses [package manager], authenticates through [authentication method], and stores exports at [destination path].
</context>
<constraints>
- Use documented LangSmith SDK or API methods available in [dependency version].
- Read credentials from environment variables and keep secrets out of source code, exported artifacts, and logs.
- Preserve the selected prompt exactly and represent variables and metadata in a reversible, machine-readable structure.
- Make the latest-versus-fixed revision behavior explicit and record the resolved revision in the export.
- Handle missing prompts, inaccessible revisions, authentication failures, and network errors with clear, actionable messages.
- Keep the implementation focused on one export operation and include only required dependencies.
- Represent unknown values as clearly named placeholders instead of inventing details.
</constraints>
<format>
Return:
1. A brief implementation summary.
2. The complete exporter code.
3. Dependency declarations for [package manager].
4. Environment-variable setup instructions using [authentication method].
5. One example command using [LangSmith organization or workspace], [prompt name or identifier], [prompt revision or latest], and [destination path].
6. A sample export schema containing prompt content, variables, resolved revision, and available metadata.
</format>
<tone>
Use concise, professional, production-oriented language. Explain security and error-handling choices clearly and keep the scope centered on the exporter.
</tone>
<final_action>
Finish with the exact command that runs the exporter and writes the selected LangSmith Hub prompt to [destination path].
</final_action>
Website Source
#text