If you have existing code that you’d like to add into Parrot (or use AI to iterate on), when creating a new snippet, you can select the “Type/Paste” tab.

When using the type/paste option, to start, you only need to provide the name of your snippet and the language/framework the snippet will be written with.

You can also select a rule set that can be used for iterations of your type/pasted snippet later. Even if you don’t intend to use AI to iterate on the snippet now, it’s recommended that you add this now as the rule set cannot be changed later.

After you’ve provided a name and language/framework, click “Create Snippet.” Parrot will redirect you to the snippet editor, providing a code block in your specified language/framework where you can paste in your snippet.

If your snippet has multiple chunks of code, you can click the “Add a Code Block” button beneath the initial editor to add the other parts in any language required. For example, if your initial code is in JavaScript but also has related HTML and CSS, you can add code blocks for those parts of the snippet separately.

Iterating on a Type/Pasted Snippet with AI

If you’d like to make changes to your type/pasted snippet using AI, you can use the “iterate” input at the bottom of the snippet editor.

To iterate, just type your instructions into the input at the bottom of the editor and then click the “Iterate” button. Parrot will automatically provide your existing code as context and return the result.