You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/essentials/command-line.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@
41
41
42
42
<asideclass="docs-sidebar" id="docs-sidebar">
43
43
<divclass="sidebar-inner">
44
-
<navclass="docs-nav"><ulclass="top-links"><li><ahref="/docs/">Home</a></li><li><ahref="/docs/whats-new.html">What's new</a></li><li><ahref="/docs/reference.html">Command reference</a></li><li><ahref="/docs/gallery/">Gallery</a></li></ul><h2>Getting started</h2><ul><li><ahref="/docs/essentials/command-line.html" class="is-active">The command-line tool</a></li><li><ahref="/docs/essentials/web-app.html">The web app</a></li></ul><h2>Examples</h2><ul><li><ahref="/docs/examples/basics.html">Basics</a></li><li><ahref="/docs/examples/globe.html">Globe locator map</a></li><li><ahref="/docs/examples/us-states.html">U.S. state map</a></li><li><ahref="/docs/examples/ny-state.html">New York map</a></li></ul><h2>Guides</h2><ul><li><ahref="/docs/guides/simplification.html">Simplification</a></li><li><ahref="/docs/guides/expressions.html">JavaScript expressions</a></li><li><ahref="/docs/guides/projections.html">Projections</a></li><li><ahref="/docs/guides/topology.html">Topology and cleaning</a></li><li><ahref="/docs/guides/combining-layers.html">Combining two layers</a></li><li><ahref="/docs/guides/programmatic.html">Using Mapshaper from Node.js</a></li></ul><h2>Formats</h2><ul><li><ahref="/docs/formats/overview.html">Overview</a></li><li><ahref="/docs/formats/shapefile.html">Shapefile</a></li><li><ahref="/docs/formats/geojson.html">GeoJSON</a></li><li><ahref="/docs/formats/topojson.html">TopoJSON</a></li><li><ahref="/docs/formats/geopackage.html">GeoPackage</a></li><li><ahref="/docs/formats/geoparquet.html">GeoParquet</a></li><li><ahref="/docs/formats/flatgeobuf.html">FlatGeobuf</a></li><li><ahref="/docs/formats/kml.html">KML / KMZ</a></li><li><ahref="/docs/formats/csv.html">CSV / TSV</a></li><li><ahref="/docs/formats/json.html">JSON records</a></li><li><ahref="/docs/formats/dbf.html">DBF</a></li><li><ahref="/docs/formats/svg.html">SVG</a></li><li><ahref="/docs/formats/snapshot.html">Mapshaper snapshot</a></li></ul></nav>
44
+
<navclass="docs-nav"><ulclass="top-links"><li><ahref="/docs/">Home</a></li><li><ahref="/docs/whats-new.html">What's new</a></li><li><ahref="/docs/reference.html">Command reference</a></li><li><ahref="/docs/gallery/">Gallery</a></li></ul><h2>Getting started</h2><ul><li><ahref="/docs/essentials/command-line.html" class="is-active">The command-line tool</a></li><li><ahref="/docs/essentials/web-app.html">The web app</a></li></ul><h2>Examples</h2><ul><li><ahref="/docs/examples/basics.html">Basics</a></li><li><ahref="/docs/examples/globe.html">Globe locator map</a></li><li><ahref="/docs/examples/us-states.html">U.S. state map</a></li><li><ahref="/docs/examples/ny-state.html">New York map</a></li></ul><h2>Guides</h2><ul><li><ahref="/docs/guides/simplification.html">Simplification</a></li><li><ahref="/docs/guides/styles-and-symbols.html">Styles and Symbols</a></li><li><ahref="/docs/guides/expressions.html">JavaScript expressions</a></li><li><ahref="/docs/guides/projections.html">Projections</a></li><li><ahref="/docs/guides/topology.html">Topology and cleaning</a></li><li><ahref="/docs/guides/combining-layers.html">Combining two layers</a></li><li><ahref="/docs/guides/programmatic.html">Using Mapshaper from Node.js</a></li></ul><h2>Formats</h2><ul><li><ahref="/docs/formats/overview.html">Overview</a></li><li><ahref="/docs/formats/shapefile.html">Shapefile</a></li><li><ahref="/docs/formats/geojson.html">GeoJSON</a></li><li><ahref="/docs/formats/topojson.html">TopoJSON</a></li><li><ahref="/docs/formats/geopackage.html">GeoPackage</a></li><li><ahref="/docs/formats/geoparquet.html">GeoParquet</a></li><li><ahref="/docs/formats/flatgeobuf.html">FlatGeobuf</a></li><li><ahref="/docs/formats/kml.html">KML / KMZ</a></li><li><ahref="/docs/formats/csv.html">CSV / TSV</a></li><li><ahref="/docs/formats/json.html">JSON records</a></li><li><ahref="/docs/formats/dbf.html">DBF</a></li><li><ahref="/docs/formats/svg.html">SVG</a></li><li><ahref="/docs/formats/snapshot.html">Mapshaper snapshot</a></li></ul></nav>
Copy file name to clipboardExpand all lines: docs/essentials/web-app.html
+41-4Lines changed: 41 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@
41
41
42
42
<asideclass="docs-sidebar" id="docs-sidebar">
43
43
<divclass="sidebar-inner">
44
-
<navclass="docs-nav"><ulclass="top-links"><li><ahref="/docs/">Home</a></li><li><ahref="/docs/whats-new.html">What's new</a></li><li><ahref="/docs/reference.html">Command reference</a></li><li><ahref="/docs/gallery/">Gallery</a></li></ul><h2>Getting started</h2><ul><li><ahref="/docs/essentials/command-line.html">The command-line tool</a></li><li><ahref="/docs/essentials/web-app.html" class="is-active">The web app</a></li></ul><h2>Examples</h2><ul><li><ahref="/docs/examples/basics.html">Basics</a></li><li><ahref="/docs/examples/globe.html">Globe locator map</a></li><li><ahref="/docs/examples/us-states.html">U.S. state map</a></li><li><ahref="/docs/examples/ny-state.html">New York map</a></li></ul><h2>Guides</h2><ul><li><ahref="/docs/guides/simplification.html">Simplification</a></li><li><ahref="/docs/guides/expressions.html">JavaScript expressions</a></li><li><ahref="/docs/guides/projections.html">Projections</a></li><li><ahref="/docs/guides/topology.html">Topology and cleaning</a></li><li><ahref="/docs/guides/combining-layers.html">Combining two layers</a></li><li><ahref="/docs/guides/programmatic.html">Using Mapshaper from Node.js</a></li></ul><h2>Formats</h2><ul><li><ahref="/docs/formats/overview.html">Overview</a></li><li><ahref="/docs/formats/shapefile.html">Shapefile</a></li><li><ahref="/docs/formats/geojson.html">GeoJSON</a></li><li><ahref="/docs/formats/topojson.html">TopoJSON</a></li><li><ahref="/docs/formats/geopackage.html">GeoPackage</a></li><li><ahref="/docs/formats/geoparquet.html">GeoParquet</a></li><li><ahref="/docs/formats/flatgeobuf.html">FlatGeobuf</a></li><li><ahref="/docs/formats/kml.html">KML / KMZ</a></li><li><ahref="/docs/formats/csv.html">CSV / TSV</a></li><li><ahref="/docs/formats/json.html">JSON records</a></li><li><ahref="/docs/formats/dbf.html">DBF</a></li><li><ahref="/docs/formats/svg.html">SVG</a></li><li><ahref="/docs/formats/snapshot.html">Mapshaper snapshot</a></li></ul></nav>
44
+
<navclass="docs-nav"><ulclass="top-links"><li><ahref="/docs/">Home</a></li><li><ahref="/docs/whats-new.html">What's new</a></li><li><ahref="/docs/reference.html">Command reference</a></li><li><ahref="/docs/gallery/">Gallery</a></li></ul><h2>Getting started</h2><ul><li><ahref="/docs/essentials/command-line.html">The command-line tool</a></li><li><ahref="/docs/essentials/web-app.html" class="is-active">The web app</a></li></ul><h2>Examples</h2><ul><li><ahref="/docs/examples/basics.html">Basics</a></li><li><ahref="/docs/examples/globe.html">Globe locator map</a></li><li><ahref="/docs/examples/us-states.html">U.S. state map</a></li><li><ahref="/docs/examples/ny-state.html">New York map</a></li></ul><h2>Guides</h2><ul><li><ahref="/docs/guides/simplification.html">Simplification</a></li><li><ahref="/docs/guides/styles-and-symbols.html">Styles and Symbols</a></li><li><ahref="/docs/guides/expressions.html">JavaScript expressions</a></li><li><ahref="/docs/guides/projections.html">Projections</a></li><li><ahref="/docs/guides/topology.html">Topology and cleaning</a></li><li><ahref="/docs/guides/combining-layers.html">Combining two layers</a></li><li><ahref="/docs/guides/programmatic.html">Using Mapshaper from Node.js</a></li></ul><h2>Formats</h2><ul><li><ahref="/docs/formats/overview.html">Overview</a></li><li><ahref="/docs/formats/shapefile.html">Shapefile</a></li><li><ahref="/docs/formats/geojson.html">GeoJSON</a></li><li><ahref="/docs/formats/topojson.html">TopoJSON</a></li><li><ahref="/docs/formats/geopackage.html">GeoPackage</a></li><li><ahref="/docs/formats/geoparquet.html">GeoParquet</a></li><li><ahref="/docs/formats/flatgeobuf.html">FlatGeobuf</a></li><li><ahref="/docs/formats/kml.html">KML / KMZ</a></li><li><ahref="/docs/formats/csv.html">CSV / TSV</a></li><li><ahref="/docs/formats/json.html">JSON records</a></li><li><ahref="/docs/formats/dbf.html">DBF</a></li><li><ahref="/docs/formats/svg.html">SVG</a></li><li><ahref="/docs/formats/snapshot.html">Mapshaper snapshot</a></li></ul></nav>
<li>The leading <code>-</code> is optional in the console: <code>clip places</code> works the same as <code>-clip places</code>.</li>
80
+
<li>The leading <code>-</code> is optional for a single console command: <code>clip places</code> works the same as <code>-clip places</code>.</li>
81
+
<li>When entering a sequence of commands, include the leading <code>-</code> before each command after the first. The examples in these docs include leading <code>-</code> prefixes because that style works in both the web console and the CLI.</li>
81
82
<li>Commands run on the <strong>currently-selected layer</strong> by default. Switch layers in the layer panel before issuing a command, or pass <code>target=</code> to be explicit (<code>target=*</code> runs against every layer).</li>
82
83
</ul>
84
+
<h3id="using-cli-examples-in-the-web-console">Using CLI examples in the web console</h3>
85
+
<p>Many Mapshaper examples are written for the command line. To run them in the web app, first load your data by dragging it onto the page or using <strong>Add files</strong>, then type only the editing commands in the Console.</p>
<p>Use the <strong>Export</strong> button when you're ready to save the result.</p>
94
+
<p>The general rules are:</p>
95
+
<ul>
96
+
<li>Drop the initial <code>mapshaper</code> command.</li>
97
+
<li>Drop input filenames such as <code>counties.shp</code> after your data has been loaded.</li>
98
+
<li>Don't use file-loading commands like <code>-i</code>, <code>-include</code> or <code>-require</code>; they are disabled in the browser console.</li>
99
+
<li>Keep the leading <code>-</code> on command names when copying examples from the docs. It works in the web console and avoids confusion in command sequences.</li>
100
+
<li>Use <code>target=</code> when you want a command to operate on a layer other than the currently selected layer.</li>
101
+
<li>Export from the web UI instead of copying the CLI <code>-o output.geojson</code> part of an example.</li>
102
+
</ul>
83
103
<h3id="magic-words-at-the-prompt">Magic words at the prompt</h3>
84
104
<p>These are recognized directly by the console, not by Mapshaper:</p>
85
105
<ul>
86
106
<li><code>history</code> — print the current session as a single command-line string. Handy for reproducing an interactive workflow as a script.</li>
87
107
<li><code>layers</code> — print the list of loaded layers.</li>
108
+
<li><code>context</code> — print the current runtime context as JSON. This is the metadata that can be shared with debugging tools or a help bot: layer names, field names/types, counts, CRS, recent commands and recent messages, but not geometry or attribute records.</li>
109
+
<li><code>context download</code> — save the same runtime context JSON to a local file.</li>
88
110
<li><code>clear</code> — clear the console buffer.</li>
89
111
<li><code>close</code> / <code>exit</code> / <code>quit</code> — close the console.</li>
90
112
</ul>
@@ -124,10 +146,25 @@ <h2 id="running-the-web-ui-locally">Running the web UI locally</h2>
124
146
<p>You can pre-load files by listing them on the command line, which skips the import dialog:</p>
<h2id="optional-ai-assistant">Optional AI assistant</h2>
150
+
<p>Some Mapshaper installations may enable an optional AI assistant by serving an <code>ai-config.js</code> file alongside the web app. If the file is missing or disabled, no assistant UI is shown.</p>
151
+
<p>When enabled, the assistant can receive the same runtime context shown by the console's <code>context</code> command: layer names, field names/types, feature counts, CRS, recent commands and recent messages. It does not include geometry or full attribute records.</p>
152
+
<p>Development builds can use a mock assistant or direct provider calls from <code>localhost</code>. Production deployments should use a proxy endpoint so provider secrets, rate limits and logging policy are not exposed in the browser.</p>
153
+
<p>An <code>ai-config.js</code> file can also point the assistant at static documentation, such as <code>llms-full.txt</code>, for providers or proxies that support prompt caching:</p>
<p>For local testing without a proxy, <code>mode: "direct"</code> supports OpenAI-compatible Responses requests and Anthropic Messages requests. Anthropic direct mode sends static context as cacheable system content when <code>provider: "anthropic"</code> is configured. Direct mode should only be used with disposable development keys on <code>localhost</code>.</p>
127
164
<h2id="browser-support">Browser support</h2>
128
165
<p>When importing very large files (hundreds of megabytes), the web app may run out of memory and crash. Firefox used to be better than Chrome at handling large files, but Chrome seems to have improved recently. If the web app crashes, try the <ahref="/docs/essentials/command-line.html"><code>mapshaper-xl</code> command-line tool</a>, which can allocate a large amount of memory.</p>
129
166
<h2id="privacy">Privacy</h2>
130
-
<p>The Mapshaper web app runs entirely in your browser. No file content is uploaded to any server. The only network traffic is for static assets (the app itself), basemap tiles when you've enabled a basemap, and analytics for <code>mapshaper.org</code> page loads. See the <ahref="/privacy.html">privacy policy</a> for details.</p>
167
+
<p>The Mapshaper web app runs entirely in your browser. No file content is uploaded to any server. The only network traffic is for static assets (the app itself), basemap tiles when you've enabled a basemap, optional AI assistant requests when an installation has enabled them, and analytics for <code>mapshaper.org</code> page loads. See the <ahref="/privacy.html">privacy policy</a> for details.</p>
131
168
132
169
<divclass="edit-link">
133
170
<ahref="https://github.com/mbloch/mapshaper/edit/master/docs/essentials/web-app.md">Edit this page on GitHub</a>
@@ -136,7 +173,7 @@ <h2 id="privacy">Privacy</h2>
136
173
</main>
137
174
138
175
<asideclass="docs-toc">
139
-
<divclass="docs-toc-title">On this page</div><ul><liclass="lvl-2"><ahref="#loading-data">Loading data</a></li><liclass="lvl-3"><ahref="#tips-for-importing-shapefiles">Tips for importing Shapefiles</a></li><liclass="lvl-2"><ahref="#the-console">The console</a></li><liclass="lvl-3"><ahref="#keyboard">Keyboard</a></li><liclass="lvl-3"><ahref="#syntax">Syntax</a></li><liclass="lvl-3"><ahref="#magic-words-at-the-prompt">Magic words at the prompt</a></li><liclass="lvl-3"><ahref="#discovering-commands">Discovering commands</a></li><liclass="lvl-2"><ahref="#the-map">The map</a></li><liclass="lvl-3"><ahref="#right-click-menu">Right-click menu</a></li><liclass="lvl-3"><ahref="#layer-navigation">Layer navigation</a></li><liclass="lvl-2"><ahref="#display-options">Display options</a></li><liclass="lvl-2"><ahref="#snapshots-and-session-history">Snapshots and session history</a></li><liclass="lvl-2"><ahref="#running-the-web-ui-locally">Running the web UI locally</a></li><liclass="lvl-2"><ahref="#browser-support">Browser support</a></li><liclass="lvl-2"><ahref="#privacy">Privacy</a></li></ul>
176
+
<divclass="docs-toc-title">On this page</div><ul><liclass="lvl-2"><ahref="#loading-data">Loading data</a></li><liclass="lvl-3"><ahref="#tips-for-importing-shapefiles">Tips for importing Shapefiles</a></li><liclass="lvl-2"><ahref="#the-console">The console</a></li><liclass="lvl-3"><ahref="#keyboard">Keyboard</a></li><liclass="lvl-3"><ahref="#syntax">Syntax</a></li><liclass="lvl-3"><ahref="#using-cli-examples-in-the-web-console">Using CLI examples in the web console</a></li><liclass="lvl-3"><ahref="#magic-words-at-the-prompt">Magic words at the prompt</a></li><liclass="lvl-3"><ahref="#discovering-commands">Discovering commands</a></li><liclass="lvl-2"><ahref="#the-map">The map</a></li><liclass="lvl-3"><ahref="#right-click-menu">Right-click menu</a></li><liclass="lvl-3"><ahref="#layer-navigation">Layer navigation</a></li><liclass="lvl-2"><ahref="#display-options">Display options</a></li><liclass="lvl-2"><ahref="#snapshots-and-session-history">Snapshots and session history</a></li><liclass="lvl-2"><ahref="#running-the-web-ui-locally">Running the web UI locally</a></li><liclass="lvl-2"><ahref="#optional-ai-assistant">Optional AI assistant</a></li><liclass="lvl-2"><ahref="#browser-support">Browser support</a></li><liclass="lvl-2"><ahref="#privacy">Privacy</a></li></ul>
0 commit comments