# LMPIFY Docs: Seamlessly Apply Repo Changes via API

## Prompt

````md path="prompt.md"
https://uithub.com/janwilmake/lmpify-docs

how to use this, e.g. to apply changes to a repo
````

## Context

````md path="context.md"

https://uithub.com/janwilmake/lmpify-docs (676 tokens) 
```plain
└── README.md


/README.md:
--------------------------------------------------------------------------------
 1 | # LMPIFY Docs
 2 | 
 3 | ## URL Context
 4 | 
 5 | Only urls that return textual results are supported for now. HTML is disabled by design to incentivize users to improve their context.
 6 | 
 7 | Some recommend contexts are:
 8 | 
 9 | - https://xymake.com for X threads
10 | - https://uithub.com for GitHub context with filters applied
11 | - https://openapisearch.com for APIs
12 | 
13 | Are you a high-agency product engineer? Join the [Context Building Club](https://contextbuilding.com) to get access to the most advanced and high-agency prompting techniques before everyone else.
14 | 
15 | ## Result format
16 | 
17 | Any lmpify URL is available as HTML, JSON, or Markdown. Browsers return HTML by default while developer or apis like `curl` or `fetch` default to markdown. You can control the output by appending `.json/.md/.html` or by specifying an `accept` header.
18 | 
19 | It's also possible to get a subset of the markdown through `?key=result|context|prompt`
20 | 
21 | Examples:
22 | 
23 | - in javascript, `fetch("https://lmpify.com/httpsuithubcomj-m8tfk00").then(res=>res.text())` returns markdown
24 | - in your terminal, `curl https://lmpify.com/httpsuithubcomj-m8tfk00` returns markdown
25 | - in the browser, https://lmpify.com/httpsuithubcomj-m8tfk00 returns the UI (html) but it's easy to get markdown using https://lmpify.com/httpsuithubcomj-m8tfk00.md or json using https://lmpify.com/httpsuithubcomj-m8tfk00.json
26 | - if you need only the result or another part, you can use https://lmpify.com/httpsuithubcomj-m8tfk00.md?key=result
27 | 
28 | ## Chat Completions
29 | 
30 | > [!IMPORTANT]
31 | > Coming soon
32 | 
33 | Every prompt is made available as [chatcompletions endpoint](https://platform.openai.com/docs/guides/text-generation) at `POST https://lmpify.com/[id]/chat/completions`. This means you can use it by setting the base path in the [OpenAI SDK](https://platform.openai.com/docs/libraries) (or other ChatCompletion SDKs) to https://lmpify.com/[id], e.g. https://lmpify.com/httpsuithubcomj-m8tfk00. This will use the context as system prompt and the prompt as a fist 'model' message in the back.
34 | 
35 | To use a model other than the default model, you can specify the model parameter. For available models, check [models.json](models.json)
36 | 
37 | ## Getting your API key
38 | 
39 | You can get your API key by going to the developer console in your browser, and find the `access_token` value in your cookies storage. This serves as authentication to any API. There's currently no scopes or ability to rotate your key, so be careful, this key is meant to be private, if it gets compromised, all your balance may be used by third parties.
40 | 
41 | ## `npx mdapply` CLI
42 | 
43 | > [!IMPORTANT]
44 | > Beta
45 | 
46 | You can use [mdapply](https://github.com/janwilmake/mdapply) to apply a response output to your local filesystem. Just run `curl "https://lmpify.com/[id]?key=result" -o apply.md && npx mdapply ./apply.md`
47 | 
48 | Try it yourself (this one will create `cli.js`) in your cwd:
49 | 
50 | ```sh
51 | curl "https://lmpify.com/httpsuithubcomj-m8tfk00?key=result" -o apply.md && npx mdapply ./apply.md
52 | ```
53 | 


--------------------------------------------------------------------------------


```


````

## Result

````md path="result.md"
# Using LMPIFY Docs to Apply Changes to a Repository

Based on the documentation provided at uithub.com/janwilmake/lmpify-docs, here's how you can use LMPIFY to apply changes to a repository:

## Key Functionality: `mdapply` CLI Tool

The primary way to apply changes to a repository is using the `mdapply` CLI tool which is mentioned in the documentation as being in beta.

### Steps to Apply Changes:

1. First, generate a response from LMPIFY that contains the changes you want to make
2. Extract just the result portion using the `?key=result` parameter
3. Save this result to a file
4. Use `npx mdapply` to apply these changes to your local filesystem/repository

### Example Command:

```sh
curl "https://lmpify.com/[your-lmpify-id]?key=result" -o apply.md && npx mdapply ./apply.md
```

Where `[your-lmpify-id]` is the unique identifier for your LMPIFY response.

### Concrete Example:

The docs provide this example that creates a `cli.js` file in your current working directory:

```sh
curl "https://lmpify.com/httpsuithubcomj-m8tfk00?key=result" -o apply.md && npx mdapply ./apply.md
```

## General Workflow:

1. Use LMPIFY to analyze your repository or generate code changes
2. Get the response in Markdown format
3. Extract just the result portion
4. Apply those changes to your repository using `mdapply`

For more details, you might want to check out the [mdapply GitHub repository](https://github.com/janwilmake/mdapply) which is referenced in the documentation.
````

