> For the complete documentation index, see [llms.txt](https://docs.podigee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.podigee.com/documentation/start-here/ai-agents/transfer-media-encode-and-publish/publish-new-local-media-from-start-to-finish.md).

# Publish new local media from start to finish

Upload a local recording, create or update an episode, encode it, and publish it safely.

Use `pdg publish` for the complete local-file workflow.

## Before you start

* Install and sign in to the pdg CLI.
* Confirm the intended account and podcast.
* Run the readiness check.
* Prepare the local media file and episode metadata.

## Publish the media

```sh
pdg --write publish episode.mp3 --podcast 42 --title "New episode" --now
```

1. Review the podcast ID, title, and publication choice.
2. Run the command with `--now`, `--at`, or neither for a draft.
3. Let pdg upload the local file and obtain its upload ID.
4. Let pdg request the server preview and confirm the exact request with the same idempotency key.
5. Keep the returned operation ID.
6. Let pdg wait for encoding and publication, or use `--no-wait` and monitor later.
7. Read the final episode and production.

Use `--episode-id` to attach new media to an existing episode. Keep the same operation ID when a confirmed workflow must resume.

## Expected result

The file uploads once, the intended episode receives one production, encoding completes, and the reviewed publication mode is applied.

## If the workflow is interrupted

Do not rerun the command as new work. Resume the upload or publication with its saved ID.

## Next step

[Recover an interrupted publication](/documentation/start-here/ai-agents/transfer-media-encode-and-publish/recover-an-interrupted-publication.md) when completion is not confirmed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.podigee.com/documentation/start-here/ai-agents/transfer-media-encode-and-publish/publish-new-local-media-from-start-to-finish.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
