codekingpro/portable-devtools
115k
1from mitmproxy.tools.console.keymap import Keymap2 3 4def map(km: Keymap) -> None:5 km.add(":", "console.command ", ["commonkey", "global"], "Command prompt")6 km.add(7 ";",8 "console.command flow.comment @focus ''",9 ["flowlist", "flowview"],10 "Add comment to flow",11 )12 km.add("?", "console.view.help", ["global"], "View help")13 km.add("B", "browser.start", ["global"], "Start an attached browser")14 km.add("C", "console.view.commands", ["global"], "View commands")15 km.add("K", "console.view.keybindings", ["global"], "View key bindings")16 km.add("O", "console.view.options", ["commonkey", "global"], "View options")17 km.add("E", "console.view.eventlog", ["commonkey", "global"], "View event log")18 km.add("Q", "console.exit", ["global"], "Exit immediately")19 km.add("q", "console.view.pop", ["commonkey", "global"], "Exit the current view")20 km.add("esc", "console.view.pop", ["commonkey", "global"], "Exit the current view")21 km.add(22 "H",23 "set console_quickhelp_visible toggle",24 ["global"],25 "Toggle quick help bar visibility",26 )27 km.add("-", "console.layout.cycle", ["global"], "Cycle to next layout")28 km.add("ctrl right", "console.panes.next", ["global"], "Focus next layout pane")29 km.add("ctrl left", "console.panes.prev", ["global"], "Focus previous layout pane")30 km.add("shift tab", "console.panes.next", ["global"], "Focus next layout pane")31 km.add("P", "console.view.flow @focus", ["global"], "View flow details")32 33 km.add("?", "console.view.pop", ["help"], "Exit help")34 35 km.add("g", "console.nav.start", ["global"], "Go to start")36 km.add("G", "console.nav.end", ["global"], "Go to end")37 km.add("k", "console.nav.up", ["global"], "Up")38 km.add("j", "console.nav.down", ["global"], "Down")39 km.add("l", "console.nav.right", ["global"], "Right")40 km.add("h", "console.nav.left", ["global"], "Left")41 km.add("tab", "console.nav.next", ["commonkey", "global"], "Next")42 km.add("enter", "console.nav.select", ["commonkey", "global"], "Select")43 km.add("space", "console.nav.pagedown", ["global"], "Page down")44 km.add("ctrl f", "console.nav.pagedown", ["global"], "Page down")45 km.add("ctrl b", "console.nav.pageup", ["global"], "Page up")46 47 km.add(48 "I",49 "set intercept_active toggle",50 ["global"],51 "Toggle whether the filtering via the intercept option is enabled",52 )53 km.add("i", "console.command.set intercept", ["global"], "Set intercept")54 km.add("W", "console.command.set save_stream_file", ["global"], "Stream to file")55 km.add(56 "A",57 "flow.resume @all",58 ["flowlist", "flowview"],59 "Resume all intercepted flows",60 )61 km.add(62 "a",63 "flow.resume @focus",64 ["flowlist", "flowview"],65 "Resume this intercepted flow",66 )67 km.add(68 "b",69 "console.command cut.save @focus response.content ",70 ["flowlist", "flowview"],71 "Save response body to file",72 )73 km.add(74 "d",75 "view.flows.remove @focus",76 ["flowlist", "flowview"],77 "Delete flow from view",78 )79 km.add(80 "D", "view.flows.duplicate @focus", ["flowlist", "flowview"], "Duplicate flow"81 )82 km.add(83 "x",84 """85 console.choose.cmd "Export as..." export.formats86 console.command export.file {choice} @focus87 """,88 ["flowlist", "flowview"],89 "Export this flow to file",90 )91 km.add("f", "console.command.set view_filter", ["flowlist"], "Set view filter")92 km.add(93 "F",94 "set console_focus_follow toggle",95 ["flowlist", "flowview"],96 "Set focus follow",97 )98 km.add(99 "ctrl l",100 "console.command cut.clip ",101 ["flowlist", "flowview"],102 "Send cuts to clipboard",103 )104 km.add(105 "L", "console.command view.flows.load ", ["flowlist"], "Load flows from file"106 )107 km.add("m", "flow.mark.toggle @focus", ["flowlist"], "Toggle mark on this flow")108 km.add(109 "M",110 "view.properties.marked.toggle",111 ["flowlist"],112 "Toggle viewing marked flows",113 )114 km.add(115 "n",116 "console.command view.flows.create get https://example.com/",117 ["flowlist"],118 "Create a new flow",119 )120 km.add(121 "o",122 """123 console.choose.cmd "Order flows by..." view.order.options124 set view_order {choice}125 """,126 ["flowlist"],127 "Set flow list order",128 )129 km.add("r", "replay.client @focus", ["flowlist", "flowview"], "Replay this flow")130 km.add("S", "console.command replay.server ", ["flowlist"], "Start server replay")131 km.add(132 "v", "set view_order_reversed toggle", ["flowlist"], "Reverse flow list order"133 )134 km.add("U", "flow.mark @all false", ["flowlist"], "Un-set all marks")135 km.add(136 "w",137 "console.command save.file @shown ",138 ["flowlist"],139 "Save listed flows to file",140 )141 km.add(142 "V",143 "flow.revert @focus",144 ["flowlist", "flowview"],145 "Revert changes to this flow",146 )147 km.add("X", "flow.kill @focus", ["flowlist"], "Kill this flow")148 km.add(149 "z",150 'console.command.confirm "Delete all flows" view.flows.remove @all',151 ["flowlist"],152 "Clear flow list",153 )154 km.add(155 "Z",156 'console.command.confirm "Purge all hidden flows" view.flows.remove @hidden',157 ["flowlist"],158 "Purge all flows not showing",159 )160 km.add(161 "|",162 "console.command script.run @focus ",163 ["flowlist", "flowview"],164 "Run a script on this flow",165 )166 167 km.add(168 "e",169 """170 console.choose.cmd "Edit..." console.edit.focus.options171 console.edit.focus {choice}172 """,173 ["flowlist", "flowview"],174 "Edit a flow component",175 )176 km.add(177 "f",178 "view.settings.setval.toggle @focus fullcontents",179 ["flowview"],180 "Toggle viewing full contents on this flow",181 )182 km.add("w", "console.command save.file @focus ", ["flowview"], "Save flow to file")183 km.add("space", "view.focus.next", ["flowview"], "Go to next flow")184 185 km.add(186 "v",187 """188 console.choose "View..." request,response189 console.bodyview @focus {choice}190 """,191 ["flowview"],192 "View flow body in an external viewer",193 )194 km.add("p", "view.focus.prev", ["flowview"], "Go to previous flow")195 km.add(196 "m",197 """198 console.choose.cmd "Set contentview..." console.flowview.mode.options199 console.flowview.mode.set {choice}200 """,201 ["flowview"],202 "Set flow view mode",203 )204 km.add(205 "z",206 """207 console.choose "Encode/decode..." request,response208 flow.encode.toggle @focus {choice}209 """,210 ["flowview"],211 "Encode/decode flow body",212 )213 214 km.add("L", "console.command options.load ", ["options"], "Load from file")215 km.add("S", "console.command options.save ", ["options"], "Save to file")216 km.add("D", "options.reset", ["options"], "Reset all options")217 km.add("d", "console.options.reset.focus", ["options"], "Reset this option")218 219 km.add("a", "console.grideditor.add", ["grideditor"], "Add a row after cursor")220 km.add(221 "A", "console.grideditor.insert", ["grideditor"], "Insert a row before cursor"222 )223 km.add("d", "console.grideditor.delete", ["grideditor"], "Delete this row")224 km.add(225 "r",226 "console.command console.grideditor.load",227 ["grideditor"],228 "Read unescaped data into the current cell from file",229 )230 km.add(231 "R",232 "console.command console.grideditor.load_escaped",233 ["grideditor"],234 "Load a Python-style escaped string into the current cell from file",235 )236 km.add("e", "console.grideditor.editor", ["grideditor"], "Edit in external editor")237 km.add(238 "w",239 "console.command console.grideditor.save ",240 ["grideditor"],241 "Save data to file as CSV",242 )243 244 km.add(245 "z",246 'console.command.confirm "Clear event log" eventstore.clear',247 ["eventlog"],248 "Clear",249 )250 251 km.add(252 "a",253 """254 console.choose.cmd "Context" console.key.contexts255 console.command console.key.bind {choice}256 """,257 ["keybindings"],258 "Add a key binding",259 )260 km.add(261 "d",262 "console.key.unbind.focus",263 ["keybindings"],264 "Unbind the currently focused key binding",265 )266 km.add(267 "x",268 "console.key.execute.focus",269 ["keybindings"],270 "Execute the currently focused key binding",271 )272 km.add(273 "enter",274 "console.key.edit.focus",275 ["keybindings"],276 "Edit the currently focused key binding",277 )278 